When using php to process some images, sometimes errors such as this will occur: Call to undefined function imagecreate()
This is a problem caused by the gd library of php not being installed or not enabled.
Solution:
1. Under the Linux system (Ubuntu system is used here)
First enter the following command in the terminal:
sudo apt-get install php5-gd
sudo service apache2 restart
2. Under Windows system
Open the php.ini configuration file in the php installation directory and find this line:
;extension=php_gd2.dll
Finally just restart the server.
The above introduces the solution to the Call to undefined function imagecreate error in PHP, including undefined and function aspects. I hope it will be helpful to friends who are interested in PHP tutorials.