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:
# apt-get install php5-gd
# apt-get install php5-gd
OR
$ sudo apt-get install php5-gd
$ sudo apt-get install php5-gd
Now restart your apache server
# /etc/init.d/apache2 restart
# /etc/init.d/apache2 restart
Test whether php5-gd library installed or not?
Type the following command:
$ php5 -m | grep -i gd
$ php5 -m | grep -i gd
The command will return “gd” if GD library installed
OR
you can test GD libraray install status by running below php code:
<?php
echo phpinfo();
?>
<?php
echo phpinfo();
?>
No comments:
Post a Comment