How to Install php gd on Ubuntu 16.04

Installation of PHP GD library before check the php version to install GD library. 

Update the packages list available in the repositories by executing second command before that run the first command "php-v" to check which version currently running. 

$ php -v
$ apt-get update
For PHP 5:

apt-get install php5-gd
For PHP7.0 use (php7.1-gd, php7.2-gd and php7.3-gd are also available):


$ sudo apt-get install php7.0-gd
It may take small bit of time otherwise its depend or dependencies of library need to update.


Now, Verification of  GD library installation, Restart apache web service by below command.


$ sudo service apache2 restart
Now let's go to the server root directory, by default it is /var/www/html/.  

Create index2.php with the code  <?php phpinfo(); ?>. 


$ cd /var/www/html/
$ sudo nano index2.php
Add this code to the file

 <?php phpinfo(); ?>
after CTRL+X  for save the file and accept the YES. 

Now, run the localhost in browser, 

http:/localhost/index2.php

Now,can view the php and gd library installed the details.

No comments:

Post a Comment

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...