Introduction

Part 1 : Installation of Apache Web-Werver with Basic Configuration

Part 2 : Install PHP support for Apache

Part 3 : MariaDB Installation

Part 4 : PHP MyAdmin Installation

 

To install PHP, open up terminal and type the following yum command.

# yum install php php-pdo php-gd php-mbstring php-mysql

Sample output:

Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 3.3 kB 00:00:00
updates | 3.4 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: centos.fastbull.org
* extras: centos.fastbull.org
* updates: centos.fastbull.org
Resolving Dependencies
–> Running transaction check
—> Package php.x86_64 0:5.4.16-21.el7 will be installed
–> Running transaction check
—> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================
Installing:
php x86_64 5.4.16-21.el7 base 1.3 M
php-gd x86_64 5.4.16-21.el7 base 122 k
php-mbstring x86_64 5.4.16-21.el7 base 499 k
php-mysql x86_64 5.4.16-21.el7 base 95 k
php-pdo x86_64 5.4.16-21.el7 base 93 k
Installing for dependencies:
libX11 x86_64 1.6.0-2.1.el7 base 605 k
libX11-common noarch 1.6.0-2.1.el7 base 181 k
libXau x86_64 1.0.8-2.1.el7 base 29 k
libXpm x86_64 3.5.10-5.1.el7 base 52 k
libjpeg-turbo x86_64 1.2.90-5.el7 base 134 k
libpng x86_64 2:1.5.13-5.el7 base 212 k
libxcb x86_64 1.9-5.el7 base 169 k
libzip x86_64 0.10.1-8.el7 base 48 k
php-cli x86_64 5.4.16-21.el7 base 2.7 M
php-common x86_64 5.4.16-21.el7 base 559 k
t1lib x86_64 5.1.2-14.el7 base 166 k

Transaction Summary
=========================================================================================================================
Install 5 Packages (+11 Dependent packages)

Total download size: 7.0 M
Installed size: 24 M
Is this ok [y/d/N]: y
Downloading packages:
(1/16): libXau-1.0.8-2.1.el7.x86_64.rpm | 29 kB 00:00:01
(16/16): php-cli-5.4.16-21.el7.x86_64.rpm | 2.7 MB 00:00:08
————————————————————————————————————————-
Total 535 kB/s | 7.0 MB 00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libXau-1.0.8-2.1.el7.x86_64 1/16
Installing : libxcb- Installing : php-mbstring-5.4.16-21.el7.x86_64 16/16
Verifying : libxcb-1.9-5.el7.x86_64 1/16
Verifying : php-mbstring-5.4.16-21.el7.x86_64 15/16
Verifying : libXau-1.0.8-2.1.el7.x86_64 16/16

Installed:
php.x86_64 0:5.4.16-21.el7 php-gd.x86_64 0:5.4.16-21.el7 php-mbstring.x86_64 0:5.4.16-21.el7
php-mysql.x86_64 0:5.4.16-21.el7 php-pdo.x86_64 0:5.4.16-21.el7

Dependency Installed:
libX11.x86_64 0:1.6.0-2.1.el7 libX11-common.noarch 0:1.6.0-2.1.el7 libXau.x86_64 0:1.0.8-2.1.el7
libXpm.x86_64 0:3.5.10-5.1.el7 libjpeg-turbo.x86_64 0:1.2.90-5.el7 libpng.x86_64 2:1.5.13-5.el7
libxcb.x86_64 0:1.9-5.el7 libzip.x86_64 0:0.10.1-8.el7 php-cli.x86_64 0:5.4.16-21.el7
php-common.x86_64 0:5.4.16-21.el7 t1lib.x86_64 0:5.1.2-14.el7

Complete!

Restart Apache service.

# service httpd restart

Sample output:

Redirecting to /bin/systemctl restart httpd.service

To verify PHP installation create one file called phpinfo.php under /var/www/html/

# vi /var/www/html/phpinfo.php

insert this php code in phpinfo.php

Save & Exit.
Then point this file in url like this http://192.168.1.200/phpinfo.php

Sample output:

PHP Support with Apache
PHP Support with Apache

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Part 3 : MariaDB Installation

Part 3 : MariaDB Installation