Centos 6.5 64bit minimal
安装mysql
[[email protected] ~]# yum install -y mysql mysql-server mysql-devel #安装
[[email protected] ~]# /etc/init.d/mysqld start #启动
[[email protected] ~]#/usr/bin/mysql_secure_installation #初始化
[[email protected] ~]# chkconfig --levels 235 mysqld on #235level启动
[[email protected] ~]# chkconfig --list |grep mysqld #look look
mysqld 0:off 1:off 2:on 3:on 4:off 5:on 6:off
安装apache
[[email protected] ~]# yum install -y httpd #安装
[[email protected] ~]# /etc/init.d/httpd start #启动
Starting httpd: httpd: Could not reliably determine the server‘s fully qualified domain name... ... #在/etc/httpd/conf/httpd.conf 加入"ServerName localhost:80"或本地域名解析
[[email protected] ~]# chkconfig --levels 235 httpd on #启动
[[email protected] ~]# chkconfig --list |grep httpd #look look
httpd 0:off 1:off 2:on 3:on 4:off 5:on 6:off
[[email protected] html]# pwd
/var/www/html #www根目录
安装PHP
[[email protected] ~]# yum install -y php #安装
[[email protected] ~]# yum install -y php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc #mysql关联
[[email protected] ~]# service httpd restart #重启httpd服务使php生效
验证php安装是否正确http://localhost/info.php
[[email protected] ~]# vi /var/www/html/info.php #建立php文件
<?php
phpinfo();
?>