1 安装PHP-安装Nginx-安装Mysql
yum install -y wget gcc gcc-c++ autoconf libjpeg libjpeg-devel perl perl* perl-CPAN libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers png jpeg autoconf gcc cmake make gcc-c++ gcc ladp ldap* ncurses ncurses-devel zlib zlib-devel zlib-static pcre pcre-devel pcre-static openssl openssl-devel perl libtoolt openldap-devel libxml2-devel ntpdate cmake gd* gd2 ImageMagick-devel jpeg jpeg* pcre-dev* fontconfig libpng libxml2 zip unzip gzip
2
./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt \
--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \
--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \
--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \
--with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli \
--with-gd --with-jpeg-dir --with-openssl
3
groupadd www
useradd -g www www
4
<?php
echo phpinfo();
?>
5
cp /解压路径/download/php-5.4.29/php.ini-production /安装路径/php/lib/php.ini
6
kill -USR2 `cat var/run/php-fpm.pid`
7
./configure --prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-pcre=/opt/pcre-8.34 \
--with-zlib=/opt/zlib-1.2.8 \
--with-openssl=/opt/openssl-1.0.1g
8
<?php
echo phpinfo();
?>
9
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
if (!-e $request_filename){
rewrite ^/V1/(.*)$ /V1/index.php?s=$1 last;
}
}
10
location ~ \.php {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
参考:
http://blog.reetsee.com/archives/296
mysql下载地址:http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.38.tar.gz