您的位置:首页 > 编程语言 > PHP开发

php5安装gd库(ubuntu下)

2016-07-19 09:47 471 查看
For CentOS / RedHat / Fedora :
sudo yum install php-gd
For Debian/ubuntu :
sudo apt-get install php5-gd

Installing freetype :

For CentOS / RedHat / Fedora :
sudo yum install freetype*
For Debian/ubuntu :
sudo apt-get install freetype*
Don't forget to restart apache after that (if you are using apache):CentOS / RedHat / Fedora :
sudo /etc/init.d/httpd restart
Or
sudo service httpd restart
Debian/ubuntu :
sudo /etc/init.d/apache2 restart
Or
sudo
service apache2 restart
注意是php5-gd,不是php-gd
 一开始就是这个不对让我花了好长时间。成功以后可以测试:
if(extension_loaded('gd')) {echo '你可以使用gd<br>';foreach(gd_info() as $cate=>$value)echo "$cate: $value<br>";}else    echo '你没有安装gd扩展';?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: