mkdir /usr/local/php
cd /usr/local/src
tar zxvf php-5.3.5.tar.gz
cd php-5.3.5
./configure --prefix=https://www.jb51.net/usr/local/php --with-config-file-path=https://www.jb51.net/usr/local/php/etc --with-mysql=https://www.jb51.net/opt/mysql --with-mysqli=https://www.jb51.net/usr/local/mysql/bin/mysql_config --with-iconv-dir=https://www.jb51.net/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=https://www.jb51.net/usr --enable-xml --disable-rpath --disable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --enable-mbstring (--with-mcrypt) --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets (--with-ldap --with-ldap-sasl )--with-xmlrpc --enable-zip --enable-soap
./configure --prefix=https://www.jb51.net/usr/local/php --enable-fpm --with-iconv=https://www.jb51.net/usr/local/bin/libiconv \--with-mcrypt=https://www.jb51.net/usr/local/bin/libmcrypt \--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
make && make install
cp php.ini-development /usr/local/php/etc/php.ini #复制配置文件
配置php-fpm
复制代码 代码如下:
cd /usr/local/php
cp etc/php-fpm.conf.default etc/php-fpm.conf
vi etc/php-fpm.conf
pid = run/php-fpm.pid
emergency_restart_threshold = 10
emergency_restart_interval = 1m
process_control_timeout = 5s
148 149行
复制代码 代码如下:
user = www
group = www
3)拷贝php配置文件 到php默认的配置文件路径
4)更改配制文件(设置时区)
复制代码 代码如下:
vim /usr/local/php/lib/php.ini
919 行,时区改为PRC,就是中华人民共和国。
date.timezone = PRC
安装nginx
安装PCRE
复制代码 代码如下:
wget
mv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gz
tar zxvf pcre-8.36.tar.gz
cd pcre-8.36 && ./configure && make && make install
安装zlib
复制代码 代码如下:
wget
tar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install
安装ssl
复制代码 代码如下:
wget
tar zxvf openssl-1.0.1j.tar.gz
安装nginx
复制代码 代码如下:
mkdir /usr/local/nginx
tar zxvf nginx-1.7.8.tar.gz
./configure --user=www --group=www --prefix=https://www.jb51.net/usr/local/nginx --with-http_stub_status_module \--pid-path=https://www.jb51.net/usr/local/nginx/nginx.pid --with-http_ssl_module \--with-pcre=https://www.jb51.net/usr/local/src/pcre-8.36 \--with-zlib=https://www.jb51.net/usr/local/src/zlib-1.2.8 \--with-openssl=https://www.jb51.net/usr/local/src/openssl-1.0.1j && make && make install
配置nginx
复制代码 代码如下:
vim /usr/local/nginx/conf/nginx.conf
启动服务器
复制代码 代码如下:
/opt/nginx/sbin/nginx
/opt/php/sbin/php-fpm。
您可能感兴趣的文章: