CentOS 5.3 + Nginx 0.7.x+ PHP 5.2.x+ MySQL 5.1.x服务器环境(2)

# tar zxvf php-5.2.10.tar.gz

# gzip -cd php-5.2.10-fpm-0.5.13.diff.gz | patch -d php-5.2.10 -p1

# cd php-5.2.10

# ./configure –prefix=/usr/local/php5 –with-config-file-path=/usr/local/etc/cgi –enable-ftp –with-curl –enable-mbregex –enable-mbstring –with-mcrypt –with-gd –with-openssl –with-jpeg-dir=/usr –with-png-dir=/usr –enable-magic-quotes –with-mysql=/usr/local/mysql –with-pear –enable-sockets –with-ttf –with-freetype-dir=/usr –enable-gd-native-ttf –with-zlib –enable-sysvsem –enable-sysvshm –with-libxml-dir=/usr –enable-force-cgi-redirect –enable-fastcgi –with-xmlrpc –enable-zip –enable-fpm –disable-cli

# make

# make install

# mkdir -p /usr/local/etc/cgi/

# cp php.ini-dist /usr/local/etc/cgi/php.ini

# mv -f /usr/local/src/php-fpm.conf /usr/local/php5/etc/php-fpm.conf

# groupadd www

# useradd -g www www

# echo ‘/usr/local/php5/sbin/php-fpm start’ >> /etc/rc.local

# cd /usr/local/src

# tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz

# cd ZendOptimizer-3.3.3-linux-glibc23-i386

# ./install
(注意第一个要填的路径是Zend安装路径,第二个是php.ini所在的路径,即/usr/local/etc/cgi)
(不要选重启apache)

# mv -f /usr/local/src/fcgi.conf /usr/local/nginx/conf/

# rm -rf /usr/local/nginx/conf/nginx.conf

# cp -f /usr/local/src/nginx.conf /usr/local/nginx/conf/nginx.conf

# vi /usr/local/nginx/conf/nginx.conf

# /usr/local/php5/sbin/php-fpm start

# service nginx restart

# vi /usr/local/nginx/conf/nginx.conf(修改主目录)

# service nginx restart

# vi /usr/local/Zend/etc/php.ini

(修改php.ini系统环境变量,上传文件大小,提交文件大小32M,session存放位置/tmp)
post_max_size = 16M
upload_max_filesize = 32M
session.save_path = "/tmp/session"

# /usr/local/php5/sbin/php-fpm stop

# /usr/local/php5/sbin/php-fpm start

# service nginx restart

#

(上传phpinfo,或者是phpmyadmin测试环境问题)

六、设置相关配置文件
1.修改系统文件描述

# ulimit -n

# ulimit -SHn 65535

# echo ‘ulimit -SHn 65535′ >> /etc/rc.local

# vi /etc/sysctl.conf (文件末尾添加下面字符)

fs.file-max=65536

# vi /etc/security/limits.conf (文件末尾添加下面字符)

* soft    nofile 65536

* hard    nofile 65536

# sysctl -p

# reboot

(重启之后,ulimit -n试试生效了没)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygsyf.html