Freshmen in the case of not compiling:
1、安装PHP5
yum install php
根据提示输入Y直到安装完成
2、安装PHP组件,使 PHP5 支持 MySQL
yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt
2. Install mysql:** The first time the installation occurs:
[[Email protected]_18_87_centos ~]# service MySQL start
Redirecting To/bin/systemctl start Mysql.service
Failed to start Mysql.service:Unit mysql.service Failed to load:no such file or directory.
[[Email protected]_18_87_centos mysql-5.5.3-m3]# service MySQL Status
Redirecting To/bin/systemctl status Mysql.service
* Mysql.service
Loaded:not-found (reason:no such file or directory)
Active:inactive (Dead)
* * Find solutions on the Web:
sudo rpm-uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
* * Once you have removed the installed MySQL, install it again:
Yum install MySQL mysql-server mysql-libs mysql-server
Finally, restart the MySQL service:
[[Email protected]_18_87_centos ~]# service MySQL start
Redirecting To/bin/systemctl start Mysql.service
Yes, it is.
[[email protected]_18_87_centos ~]# service MySQL status
redirecting to/bin/systemctl status mysql.service
* mysqld.service-mysql Community Server
loaded:loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset:disabled)
Active:active ( Running) since Sun 2016-11-20 16:02:08 CST; 3s ago
process:16986 Execstartpost=/usr/bin/mysql-systemd-start Post (code=exited, status=0/success)
Process: 16923 Execstartpre=/usr/bin/mysql-systemd-start Pre (code=exited, status=0/success)
Main pid:16985 (Mysqld_safe)
CGroup:/system.slice/mysqld.service
|-16985/bin/sh/usr/bin/mysqld_safe
' -17139/usr/sbin/mysqld-- BASEDIR=/USR--datadir=/var/lib/mysql--plugin-...
Nov 16:02:07 Vm_18_87_centos mysql-systemd-start[16923]: support for MySQL by buying s ...
Nov 16:02:07 Vm_18_87_centos mysql-systemd-start[16923]: note:new Default Config ...
Nov 16:02:07 Vm_18_87_centos mysql-systemd-start[16923]: Please make sure your con ...
Nov 16:02:07 Vm_18_87_centos mysql-systemd-start[16923]: Warning:default config f ...
Nov 16:02:07 Vm_18_87_centos mysql-systemd-start[16923]: This file is being read by ...
Nov 16:02:07 Vm_18_87_centos mysql-systemd-start[16923]: If You don't want to use ...
Nov 16:02:07 Vm_18_87_centos mysql-systemd-start[16923]:--defaults-file argument ...
Nov 16:02:07 Vm_18_87_centos mysqld_safe[16985]: 161120 16:02:07 mysqld_safe Logg ....
Nov 16:02:07 Vm_18_87_centos mysqld_safe[16985]: 161120 16:02:07 mysqld_safe STAR...L
Nov 16:02:08 Vm_18_87_centos systemd[1]: Started MySQL Community Server.
Hint:some lines were ellipsized, use-l to show on full.
CentOS Install PHP and MySQL