Centos 6.5 64bit minimal
安装mysql
[root@ftp ~]# yum install -y mysql mysql-server mysql-devel #安装
[root@ftp ~]# /etc/init.d/mysqld start #启动
[root@ftp ~]#/usr/bin/mysql_secure_installation #初始化
[root@ftp ~]# chkconfig --levels 235 mysqld on #235level启动
[root@ftp ~]# chkconfig --list |grep mysqld #look look
mysqld 0:off 1:off 2:on 3:on 4:off 5:on 6:off
安装apache
[root@ftp ~]# yum install -y httpd #安装
[root@ftp ~]# /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"或本地域名解析
[root@ftp ~]# chkconfig --levels 235 httpd on #启动
[root@ftp ~]# chkconfig --list |grep httpd #look look
httpd 0:off 1:off 2:on 3:on 4:off 5:on 6:off
[root@ftp html]# pwd
/var/www/html #www根目录
安装PHP
[root@ftp ~]# yum install -y php #安装
[root@ftp ~]# yum install -y php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc #mysql关联
[root@ftp ~]# service httpd restart #重启httpd服务使php生效
验证php安装是否正确http://localhost/info.php
[root@ftp ~]# vi /var/www/html/info.php #建立php文件
<?php
phpinfo();
?>
原文:http://www.cnblogs.com/haoym/p/4454877.html