Step To Install PHP5.4 Version On Linux

Step to install PHP5.4 is a widely used scripting language for web development. This is also an open source scripting language. you can make website based on php.  

The file extension is .php and the path of php file stored at location /var/www/html/test.php

For php there must be web server installed on your system e.g Apache or nginx etc.

Check Out : Missing PHP-mbstring installing Zabbix Monitoring

Packages required

  1. Php
  2. Php-mysql # mysql Server , you can any other database server
  3. Php-gd
  4. Php-pear

Php-gd = A module for PHP applications for using the gd graphics library

Php-pear = PHP Extension and Application Repository framework

Other Packages are mentioned below you can install them according to your need

  1. OPcache (php-opcache)
  2. APCu (php-pecl-apcu)
  3. CLI (php-cli)
  4. PDO (php-pdo)
  5. PostgreSQL (php-pgsql)
  6. MongoDB (php-pecl-mongodb)
  7. Redis (php-pecl-redis)
  8. Memcache (php-pecl-memcache)
  9. MCrypt (php-mcrypt)
  10. XML (php-xml)

Step 1 : Install PHP using Yum

Check Out : Install PHP 7.2 Hypertext Preprocessor on Ubuntu

Note : Must have web server installed on machine.

yum install php php-mysql.x86_64 php-gd.x86_64 php-pear.noarch  –y

Step 2: Now create a test file under the directory /var/www/html/test.php

Put these line in the file test.php

<?php

Phpinfo();

?>

And save the file.

Step 3 : Now restart the Apache server service

systemctl restart httpd

Now go to the browser type http://192.168.184.177/test.php replace IP with your or run on localhost http://localhost/test.php

Check Out : How To Install LAMP (linux, Apache ,Mysql ,PHP)

You will see this page if php is successfully installed and working.

That’s it

Leave a Reply

avatar
  Subscribe  
Notify of