I have image creating php script . It works fine when i access it from the browser . But when it is called from a shell script it shows the following error .
PHP Fatal error: Call to undefined function imagecreate()
I have image creating php script . It works fine when i access it from the browser . But when it is called from a shell script it shows the following error .
PHP Fatal error: Call to undefined function imagecreate()
PHP CLI probably doesn't use the same configuration file than the browser one. So it doesn't load the GD library.
You could either force him to use the same .ini file :
php -c /directory/php.ini phpscript.php
Or add the following line in your PHP CLI configuration file :
; Enable gd extension module
extension=gd.so