If you get the following error message in PHP then it means you need to have the PHP GD extension installed. Obviously the /path/to/file.php will be the actual path and filename of the PHP script the error occured in, and the line number will be the actual line.
You'll also get this error message using other functions such as ImageCreateFromJPEG() if the PHP GD library is not installed.
On CentOS, Red Hat's Enterprise Linux and Fedora, you can easily add the PHP GD library from the command line using the command listed below, either as the root user or using sudo. You can also install it using the graphical software installation tools by searching for "php-gd" and installing from there.
After hitting <enter> the command will run and you'll get output similar to the following:
At this point you type in "Y" and hit <enter>. It will then install the PHP GD library.
The installation is now complete. However, you still can't use the GD functions until you have reloaded the Apache web server like so, using either sudo or running it as root:
Note that just doing a "reload" seems to work OK, it doesn't have to be a full "restart".
This is how to install the PHP GD library from the command line using Fedora, CentOS or Red Hat's Enterprise Linux and other Linux deritives. The process and package name will be similar using other Linux and BSD distros.
0 comments:
Post a Comment