Install LAMP :Linux, Apache, MySQL(Mariadb), PHP 7.3 On CentOS 7
The Following tutorial is about installing LAMP on CENTOS 7
Do the update and upgrade to latest version:
rprasad@localhost:~$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
rprasad@localhost:~$ sudo yum clean all
[sudo] password for rprasad:
Loaded plugins: fastestmirror
Cleaning repos: base epel extras mongodb-org-4.0 remi-php73 remi-safe updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned d ata from disabled or removed repos
Cleaning up list of fastest mirrors
rprasad@localhost:~$ sudo yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 5.6 kB 00:00
* base: centos.mirror.myduniahost.com
* epel: mirror.ehost.vn
* extras: centos.biz.net.id
* remi-php73: mirror.xeonbd.com
* remi-safe: mirror.xeonbd.com
* updates: centos.mirror.myduniahost.com
base | 3.6 kB 00:00
epel | 3.2 kB 00:00
extras | 3.4 kB 00:00
mongodb-org-4.0 | 2.5 kB 00:00
remi-php73 | 3.0 kB 00:00
remi-safe | 3.0 kB 00:00
Step 1: Install Apache Server with Basic Configurations
Installation of Apache :
rprasad@localhost:~$sudo yum install httpd
Starting of Apache :
rprasad@localhost:~$sudo systemctl start httpd.service
Enable of Apache :
rprasad@localhost:~$sudo systemctl enable httpd.service
Status of Apache :
rprasad@localhost:~$systemctl status httpd.service
Open Firewall for HTTP/HTTPS and reload firewall rule :
rprasad@localhost:~$sudo firewall-cmd --permanent --zone=public --add-service=http
rprasad@localhost:~$sudo firewall-cmd --permanent --zone=public --add-service=https
rprasad@localhost:~$sudo firewall-cmd --reload
Verify Apache installed correctly:
http://192.168.17.129/ [Check your IP address]
Step 2: Install PHP
Install and enable EPEL and Remi repository to your CentOS 7
rprasad@localhost:~$sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rprasad@localhost:~$sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rprasad@localhost:~$sudo yum install yum-utils
rprasad@localhost:~$sudo yum-config-manager --disable remi-php54 [Disable default PHP]
Select from your desired version of PHP :
rprasad@localhost:~$sudo yum-config-manager --enable remi-php70 [Install PHP 7.0]
rprasad@localhost:~$sudo yum-config-manager --enable remi-php71 [Install PHP 7.1]
rprasad@localhost:~$sudo yum-config-manager --enable remi-php72 [Install PHP 7.2]
rprasad@localhost:~$sudo yum-config-manager --enable remi-php73 [Install PHP 7.3]
Install package for PHP now :
rprasad@localhost:~$sudo yum -y install php php-mysql php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-soap
Verify the php:
rprasad@localhost:~$ php -v
PHP 7.3.0 (cli) (built: Dec 4 2018 16:12:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
Do the update and upgrade to latest version:
rprasad@localhost:~$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
rprasad@localhost:~$ sudo yum clean all
[sudo] password for rprasad:
Loaded plugins: fastestmirror
Cleaning repos: base epel extras mongodb-org-4.0 remi-php73 remi-safe updates
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned d ata from disabled or removed repos
Cleaning up list of fastest mirrors
rprasad@localhost:~$ sudo yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 5.6 kB 00:00
* base: centos.mirror.myduniahost.com
* epel: mirror.ehost.vn
* extras: centos.biz.net.id
* remi-php73: mirror.xeonbd.com
* remi-safe: mirror.xeonbd.com
* updates: centos.mirror.myduniahost.com
base | 3.6 kB 00:00
epel | 3.2 kB 00:00
extras | 3.4 kB 00:00
mongodb-org-4.0 | 2.5 kB 00:00
remi-php73 | 3.0 kB 00:00
remi-safe | 3.0 kB 00:00
Step 1: Install Apache Server with Basic Configurations
Installation of Apache :
rprasad@localhost:~$sudo yum install httpd
Starting of Apache :
rprasad@localhost:~$sudo systemctl start httpd.service
Enable of Apache :
rprasad@localhost:~$sudo systemctl enable httpd.service
Status of Apache :
rprasad@localhost:~$systemctl status httpd.service
Open Firewall for HTTP/HTTPS and reload firewall rule :
rprasad@localhost:~$sudo firewall-cmd --permanent --zone=public --add-service=http
rprasad@localhost:~$sudo firewall-cmd --permanent --zone=public --add-service=https
rprasad@localhost:~$sudo firewall-cmd --reload
Verify Apache installed correctly:
http://192.168.17.129/ [Check your IP address]
Step 2: Install PHP
Install and enable EPEL and Remi repository to your CentOS 7
rprasad@localhost:~$sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rprasad@localhost:~$sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rprasad@localhost:~$sudo yum install yum-utils
rprasad@localhost:~$sudo yum-config-manager --disable remi-php54 [Disable default PHP]
Select from your desired version of PHP :
rprasad@localhost:~$sudo yum-config-manager --enable remi-php70 [Install PHP 7.0]
rprasad@localhost:~$sudo yum-config-manager --enable remi-php71 [Install PHP 7.1]
rprasad@localhost:~$sudo yum-config-manager --enable remi-php72 [Install PHP 7.2]
rprasad@localhost:~$sudo yum-config-manager --enable remi-php73 [Install PHP 7.3]
Install package for PHP now :
rprasad@localhost:~$sudo yum -y install php php-mysql php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-soap
Verify the php:
rprasad@localhost:~$ php -v
PHP 7.3.0 (cli) (built: Dec 4 2018 16:12:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
Create info.php page:
rprasad@localhost:~$sudo vi /var/www/html/info.php
Content:
rprasad@localhost:~$ cat /var/www/html/info.php
<?php
phpinfo();
?>
Restart Apache server :
Comments
Post a Comment