0

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!

Anoop Santhanam
  • 85
  • 1
  • 10

1 Answers1

1

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

Community
  • 1
  • 1
  • Thanks for getting back quickly! Tried this, but unfortunately, this is what I'm getting. [06-Jan-2014 15:40:25 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/gd.so' - libpng16.so.16: cannot open shared object file: No such file or directory in Unknown on line 0 – Anoop Santhanam Jan 06 '14 at 15:41
  • Okay I got it! Sorry about the previous comment. Due to my earlier attempts at getting it done, I had a faulty/corrupt copy of gd.so in my extensions directory. I replaced it with a fresher version, uncommented the line from php.ini and it works. Thank you so much! – Anoop Santhanam Jan 06 '14 at 16:23