Anoop Santhanam
Anoop Santhanam

Reputation: 85

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. MY service provider had initially disabled the GD package that comes with PHP. I managed to edit yum.conf and installed php-gd. It said somewhere on Stackoverflow that if I run

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. 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. I ran a sample GD program and it says

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. So, I'm pretty sure I may have missed something.

Thanks in advance!

Upvotes: 0

Views: 3246

Answers (1)

Łukasz Pijet
Łukasz Pijet

Reputation: 302

You have to enable extension in php.ini; Add following line to configuration.

extension=gd.so

Btw. Meybe php-gd packet created a file that has this line commented. In Debian it can be found at /etc/php5/apache2/conf.d

Also look at: CentOS: Enabling GD Support in PHP Installation

Upvotes: 1

Related Questions