4

On the localhost the library is working fine, when the function is called on production,php throws a fatal errer.

i checked the phpinfo() its there and it is enabled.

I tired to see if there is anything that i can add on the php.ini but i couldn't find any. The error is thrown when i call

gd_info();

Is there anything that i can add on the php.ini file that can solve this problem, or is there another library for gd?

The error am getting is the following

Fatal error: Call to undefined function gd_info(
zf.
  • 123
  • 1
  • 1
  • 10
  • 3
    check in your php.ini extension=gd.so extension=gd2.so extension=php_gd2.so – red eyes dev Jun 05 '11 at 16:38
  • 2
    Assuming you are linux, red eyes dev is correct. Additionally, make sure (at least one of) those files exist in your PHP extensions directory. – SamT Jun 05 '11 at 16:39
  • If you can see it in phpinfo(), with no doubt it's installed correctly. The problem is related to calling progress. gd_info should get called with some another syntax I guess. – A23149577 Aug 28 '13 at 11:56
  • 1
    possible duplicate of [Fatal error: Call to undefined function imagefilter()](http://stackoverflow.com/questions/563355/fatal-error-call-to-undefined-function-imagefilter) – Paul Sweatte Jan 30 '15 at 21:20

2 Answers2

1

It may be a little bit late, but I hope it helps anyone.

I had the same problem when I tried to run GD over apache. The problem was in php.ini path for apache. By default it is not using php.ini from php directory. You need to define PHPIniDir in httpd file or place copy of php.ini to apache folder.

To check if it is your case you can compare output of php --ini from php folder and output of phpinfo() over apache. If it is showing different php.ini destinations you need to fix it.

Egor
  • 1,334
  • 8
  • 22
0

I had exactly the same problem

although I had installed it using apt-get install php7.0-gd that function was undefined, so I inspected php.ini file in /etc/php/7.0/apache2/php.ini

turned out that the line for gd extension was commented!

so I removed semicolon before the line and it was working!

so crazy wasted an half an hour of mine :D

Developerium
  • 7,155
  • 5
  • 36
  • 56