Step To Install PHP5.4 Version On Redhat / CentOS 7

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 a website based on PHP. We can install, configure, and check the PHP 5.4 version in Linux before installing.

Step To Install PHP5.4 Version On Linux:

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

For PHP there must be a 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 a web server installed on the 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


Save the file.

Step 3: Now restart the Apache server service

systemctl restart httpd

check php version

Now go to the browser type 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.

linux install php5.4

That’s it check php version configure php5.4 install linux

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment