How to install apache and php on centos 7

By | July 25, 2017

Apache web server is free and open-source cross-platform web server software.It is fast,reliable and secure.It runs on 67% of all webservers in the world.

Install Apache

To install Apache by using the below command

yum install httpd

Install PHP

To install PHP by using the below command

yum install php

Install PHP modules

search the available PHP modules by using the below command

yum search php-

To know the short information of the module by using the below command

yum info module-name

For example,I have to know mysql module information using below command

yum info php-mysql

To install mutliple php module by using below command

yum install php-modulename

For example,I have to install few module using below command

yum install php-mysql.x86_64 php-cli.x86_64 php-bcmath.x86_64

Finally restart the apache web server by using the below command

service httpd restart

check the apache configuration fileis configured with the server name.

Using below command to check the configuration file

nano /etc/httpd/conf/httpd.conf

You can check it by accessing your server in browser by your IP address

Category: VPS

Leave a Reply

Your email address will not be published. Required fields are marked *