简体   繁体   English

在PHP中启用GD的问题

[英]Issue with enabling GD in PHP

Okay, I know a similar question has been asked before, but my problem seems to have gotten a little confusing. 好的,我知道之前也有人问过类似的问题,但是我的问题似乎有点令人困惑。

I have a cloud service set up on centOS with PHP. 我在具有PHP的centOS上设置了云服务。 MY service provider had initially disabled the GD package that comes with PHP. 我的服务提供商最初禁用了PHP随附的GD软件包。 I managed to edit yum.conf and installed php-gd. 我设法编辑yum.conf并安装了php-gd。 It said somewhere on Stackoverflow that if I run 它在Stackoverflow的某个地方说,如果我运行

yum install php-gd

it should work. 它应该工作。 It did. 它做了。 It said installed. 它说安装。 I did the usual restarting of Apache to ensure the changes were implemented, but nothing happened. 我按照常规方式重新启动了Apache,以确保更改得以实施,但是什么也没有发生。 I've looked everywhere but according to wherever I've seen, it says the above command should do the trick. 我到处都看过,但是根据我所见过的地方,上面的命令应该可以解决问题。 I even went ahead restarted the whole cloud server to see if it made a difference. 我什至继续重新启动了整个云服务器,以查看是否有所作为。 It didn't. 没有。

When I run phpinfo(), GD isn't listed. 当我运行phpinfo()时,未列出GD。 I ran a sample GD program and it says 我运行了一个示例GD程序,它说

Fatal error: Call to undefined function imagecreatefromjpeg() in ....

I have absolutely no idea. 我完全不知道。 I've tried contacting the support team but they've been unresponsive. 我曾尝试与支持团队联系,但他们一直没有回应。

Also, I'm a beginner in Unix/Linux commands. 另外,我还是Unix / Linux命令的初学者。 So, I'm pretty sure I may have missed something. 所以,我很确定我可能错过了一些东西。

Thanks in advance! 提前致谢!

You have to enable extension in php.ini; 您必须在php.ini中启用扩展名; Add following line to configuration. 将以下行添加到配置。

extension=gd.so

Btw. 顺便说一句。 Meybe php-gd packet created a file that has this line commented. Meybe php-gd数据包创建了一个带有此行注释的文件。 In Debian it can be found at /etc/php5/apache2/conf.d 在Debian中可以在/etc/php5/apache2/conf.d中找到

Also look at: CentOS: Enabling GD Support in PHP Installation 另请参阅CentOS:在PHP安装中启用GD支持

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM