First, install
ApacheServer
install httpd
Second, install PHP and common software packages
yum install php httpd-manual mod_ssl mod_perl mod_auth_mysqlyum install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpcyum install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
Third, install MARIADB
install
Iv. Start the service
start httpd.servicesystemctl start mariadb.service
Five, if the fourth succeeds, set up two services to start automatically
systemctl enable httpd.servicesystemctl enable mariadb.service
VI, set up the database server
[Root@rachel ~]# mysql-u Root #无密码登录数据库Welcome to theMariaDB Monitor. CommandsEnd with;or\g.your MariaDB ConnectionID is3Serverversion:5.5. the-MARIADB MariaDB Servercopyright (c) -, -, Oracle, MariaDB Corporation Ab andOthers. Type ' help; 'or' \h ' forHelp. Type ' \c ' toClear theCurrent input statement. MariaDB [(None)]> Select User, host, password fromMysql.user;#检索数据库用户+------+--------------+----------+| user | Host | Password |+------+--------------+----------+| Root | localhost | || Root | Rachel | || Root |127.0. 0. 1| || Root | ::1| || | localhost | || | Rachel | |+------+--------------+----------+6RowsinchSet(0.00SEC) MariaDB [(none)]> Delete fromMysql.userwhereUser= "; Query OK,2Rows Affected (0.00Sec#删除匿名用户MariaDB [(none)]> Delete fromMysql.userwhereUser= ' Root ' andHost= '::1';#删除IPv6方式登录用户Query OK,1Row affected (0.00SEC) MariaDB [(None)]> Select User, host, password fromMysql.user;#再次查看用户+------+--------------+----------+| user | Host | Password |+------+--------------+----------+| Root | localhost | || Root | Rachel | || Root |127.0. 0. 1| |+------+--------------+----------+3RowsinchSet(0.00SEC) MariaDB [(None)]>SetPassword forRoot@localhost=password (' XXXXXX ');#修改本地登录密码Query OK,0Rows Affected (0.00SEC) MariaDB [(None)]>SetPassword forRoot@rachel=password (' XXXXXX ');#修改本地登录密码Query OK,0Rows Affected (0.00SEC) MariaDB [(None)]>SetPassword forroot@ '127.0. 0. 1' =password (' XXXXXX ');#修改本地登录密码Query OK,0Rows Affected (0.00SEC) MariaDB [(None)]> Select User, host, password fromMysql.user;#查看密码+------+--------------+-------------------------------------------+| user | Host | Password |+------+--------------+-------------------------------------------+| Root | localhost | *1728fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx | | Root | Rachel | *1728fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx | | Root |127.0. 0. 1| *1728Fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx |+------+--------------+-------------------------------------------+3RowsinchSet(0.00SEC) MariaDB [(None)]>Exit#退出Bye[root@rachel ~]# mysql-u Root-p #再次用密码登录测试Enter Password:welcome to theMariaDB Monitor. CommandsEnd with;or\g.your MariaDB ConnectionID is4Serverversion:5.5. the-MARIADB MariaDB Servercopyright (c) -, -, Oracle, MariaDB Corporation Ab andOthers. Type ' help; 'or' \h ' forHelp. Type ' \c ' toClear theCurrent input statement. MariaDB [(None)]>ExitBye[root@rachel ~]# #测试成功
The above describes the CentOS7 installation apache+php+mariadb, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.