PHP is not limited to creating just HTML output. you can create image files using PHP. It just needs to install GD libraray to create variety of image formats like GIF, PNG, JPEG, WBMP, and XPM. PHP output image streams directly to a browser. You will need to compile PHP with the GD library of image functions for this to work. GD and PHP may also require other libraries, depending on which image formats you want to work with.
In this post you will learn how to install PHP GD Module on Ubuntu.
Type the following command to install this module:
Now restart your apache server
Test whether php5-gd library installed or not?
Type the following command:
The command will return “gd” if GD library installed
you can test GD libraray install status by running below php code