Page 1 of 1

Fatal error: Call to undefined function imagecreatefromjpeg(

Posted: Thu May 18, 2006 10:28 pm
by lostinfog
My environment: Apache 2.0.55, PHP 5.1.2 Windows XP
I've changed my php.ini, removed the ; before extension=php_gd2.dll. Also php_gd2.dll can be found in php/ext/ dir.
I've checked the phpinfo() output. Only one line about gd, "Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"".
What's the error cause?
Thanks in advance!

Posted: Thu May 18, 2006 10:40 pm
by feyd
forget to restart apache?

Posted: Thu May 18, 2006 10:56 pm
by lostinfog
Restart Apache several times. The error remains. :(

Posted: Thu May 18, 2006 11:03 pm
by Christopher
Is extension_dir set correctly in php.ini? I should look something like:

extension_dir = "c:/my/path/to/php-5.1.2-Win32/ext/"

If the extension is loaded it will show up as its own section in phpinfo().

Posted: Thu May 18, 2006 11:05 pm
by feyd
Are you 100% sure you've edited the right php.ini file? The ini php loaded is listed near the top of phpinfo().

When running phpinfo(), if you don't see an entire section about GD its extension isn't loaded.

Fix it!

Posted: Thu May 18, 2006 11:16 pm
by lostinfog
Many thanks!
You're right. I modified the extension_dir in php.ini and it works.
Some time ago, I uncommented line "extension=php_mysql.dll", then mysql support is ok. Since mysql extension can work without correct extension_dir setting, why gd cannot? It's a bit confusing. That's also why I didn't check the extension_dir setting.