1 安装源 rpm -Uvh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 2 更新并安装基本库 yum -y update yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel 3 安装Apache和mysql yum --enablerepo=remi -y install mysql mysql-server mysql-devel httpd httpd-devel chkconfig httpd on chkconfig mysqld on service mysqld startmysql安全设置 mysql_secure_installationmysql -u root -p 输入密码 建立你要用数据库。。。 4 安装php yum --enablerepo=remi -y install php php-mysql php-common php-devel php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel 加密模块 wget http://www.dmasoftlab.com/cont/download/ioncube_loaders_lin_x86-64.tar.gz tar zxvf ioncube_loaders_lin_x86-64.tar.gz cp -rf ioncube /usr/local/ sed -i 's/post_max_size = 8M/post_max_size = 50M/g' /etc/php.ini sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 50M/g' /etc/php.ini sed -i 's/;date.timezone =/date.timezone = PRC/g' /etc/php.ini sed -i 's/; cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g' /etc/php.ini sed -i 's/max_execution_time = 30/max_execution_time = 300/g' /etc/php.ini sed -i 's/disable_functions =.*/disable_functions =passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g' /etc/php.ini echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so" >> /etc/php.ini php加速模块 wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz tar -zxvf xcache-3.2.0.tar.gz cd xcache-3.2.0 phpize --clean phpize ./configure --enable-xcache make && make install cat xcache.ini >> /etc/php.ini vi /etc/httpd/conf/httpd.conf 将DirectoryIndex后添加index.php service httpd start 5 测试 vi /var/www/html/index.php <?php phpinfo(); ?> 在浏览器输入http://yourserverip/,看到phpinfo信息就OK |