1.安装apache:
yum install httpd httpd-devel
2.安装mysql:
yum install mysql mysql-server
3.安装php:
yum install php php-devel
4.安装php的扩展:
yum
install
php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mcrypt
5.启动apache和mysql服务:
service httpd restart
service mysqld restart
6.修改mysql密码
mysql> set password for root@localhost = password('test');
7.配置apache
#NameVirtualHost *:80 取消注释
#ServerName localhost:80 取消注释
8.升级php
以下为 CentOS 下安装 PHP 方法:
添加 epel 源
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
添加 remi 源
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
安装 PHP
# yum --enablerepo=remi,remi-php55 install php-fpm php-common php-devel php-mysqlnd php-mbstring php-mcrypt
查看 PHP 版本
# php -v
PHP 5.5.9 (cli) (built: Feb 11 2014 08:25:33)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
启动 php-fpm
# service php-fpm start
Starting php-fpm: [ OK ]