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.
- Php-mysql # mysql Server, you can any other database server
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
- OPcache (php-opcache)
- APCu (php-pecl-apcu)
- CLI (php-cli)
- PDO (php-pdo)
- PostgreSQL (php-pgsql)
- MongoDB (php-pecl-mongodb)
- Redis (php-pecl-redis)
- Memcache (php-pecl-memcache)
- MCrypt (php-mcrypt)
- 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
<?php Phpinfo(); ?>
Save the file.
Step 3: Now restart the Apache server service
systemctl restart httpd
You will see this page if PHP is successfully installed and working.
That’s it check php version configure php5.4 install linux