Startingfrom the latestversionof theLinuxsystem, the defaultisMariadb,notMySQL!

Repos that come using the systeminstallationissimple:

# yum install -y mariadb mariadb-server

Start the mariadb

# systemctl start mariadb

Servicemanagementbefore the commandcanalso be used

# service mariadb start

Setpostlaunch

# systemctl enable mariadb

Securityinitialized,set the rootpassword

# mysql_secure_installation

Testlogin

#MySQL-uroot-p123456//the password123456

2.install the Apache software

# yum -y install httpd

# systemctl start httpd.service

# systemctl enable httpd.service

#Systemctlstatushttpd.service//checkstatus

“Enabled“indicates that the httpdserviceissettoboot,“active(running)“inthehttpdserviceisrunning.

3.installPHP

# yum -y install php

InstallationPHP-MySQL

PHP-MySQLisaPHP program that usesMySQL databasemodule.Toinstallthismodule,use the command:

# yum -y install php-mysql

#Systemctlrestarthttpd//restart the httpdservice

After the installation is complete,PHP willgenerate a configurationfile/etc/httpd/conf.d/PHP.confbecausetheconfigurationfilein/etc/httpd/conf.ddirectory,soitcanbereadbyApache.PHP alsogenerates the configurationfile/etc/httpd/conf.modules.d/10-PHP.conf,theconfigurationfileswillbereadbyApache,it‘ssettingallowsApache toload the PHP module.However,PHP configurationfilesof the softwareitselfisin fact/etc/php.ini.

You cantest:totestApache wouldnormallycall the PHP,createaphpinfo.phpfilein the/var/www/htmldirectory, as shownbelow:

<?Phpphpinfo();?>//<?php?>is the syntaxof the PHP program,phpinfo()is a PHP program to providealibrary,thelibrarycandisplayinformation about yourWebserver.