6. PHP的源码包,php-5.3.3.tar.gz6
yum install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*
sudo mkdir –p /usr/local/web sudo mkdir -p /usr/local/web/lib #存放扩展lib目录
sudo tar zvxf zlib-1.2.3.tar.gz cd zlib-1.2.3 sudo ./configure --prefix=/usr/local/web/lib/zlib sudo make CFLAGS=-fpic sudo make install <span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"> </span>
sudo tar zxvf jpegsrc.v6b.tar.gz cd jpeg-6b sudo ./configure --prefix=/usr/local/web/lib/jpeg sudo make sudo mkdir /usr/local/web/lib/jpeg #创建目录 sudo mkdir /usr/local/web/lib/jpeg/include sudo mkdir /usr/local/web/lib/jpeg/lib sudo make install-lib sudo mkdir /usr/local/web/lib/jpeg/bin sudo mkdir /usr/local/web/lib/jpeg/man sudo mkdir /usr/local/web/lib/jpeg/man/man1 sudo make install
sudo tar zxvf libpng-1.2.8-config.tar.gz cd libpng-1.2.8-config sudo ./configure --prefix=/usr/local/web/lib/libpng sudo make CFLAGS=-fpic sudo make install
sudo tar zxvf freetype-2.1.10.tar.gz cd freetype-2.1.10 sudo ./configure --prefix=/usr/local/web/lib/freetype sudo make sudo make install
sudo tar xzvf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7 sudo ./configure --prefix=/usr/local/web/lib/libmcrypt sudo make sudo make install
sudo tar zxvf php-5.3.3.tar.gz cd php-5.3.3 sudo ./configure --prefix=/usr/local/web/php.5.3.3 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib --with-gd --with-freetype-dir=/usr/local/web/lib/freetype --with-jpeg-dir=/usr/local/web/lib/jpeg --with-png-dir=/usr/local/web/lib/libpng --with-iconv --enable-fpm --enable-cgi --enable-static --enable-maintainer-zts --enable-zend-multibyte --enable-inline-optimization --enable-sockets --enable-wddx --enable-zip --enable-calendar --enable-bcmath --enable-ftp --enable-soap --enable-mbstring --without-sqlite --disable-ipv6 --disable-debug --with-mcrypt sudo make sudo make install我们已经准备了两个php.ini配置文件和php-fpm.conf配置文件,默认的配置一般不能满足于我们的需求(如果您没有,那不需要拷贝)。将配置文件拷贝
sudo cp ../php.ini /usr/local/web/php.5.3.3/lib/php.ini sudo cp ../php-fpm.conf /usr/local/web/php.5.3.3/etc/php-fpm.conf sudo chmod -R 777 /usr/local/web/php.5.3.3/var/log/设置linux的连接数最大值,默认是1024. 在高负载下要设置为更高,但最高只能为65535。由于重启后失效,可以加入/etc/rc.d/rc.local开机就启动
ulimit -SHn 65535 启动PHP fpm进程 [plain] view plaincopyprint? /usr/local/web/php.5.3.3/sbin/php-fpm 查看PHP fpm进程 [plain] view plaincopyprint? ps –ef | grep php-fpm #查看PHP进程 管理PHP [plain] view plaincopyprint? #启动 /usr/local/web/php.5.3.3/sbin/php-fpm #重启 kill -USR2 `cat /usr/local/web/php.5.3.3/var/run/php-fpm.pid` #停止 kill -INT `cat /usr/local/web/php.5.3.3/var/run/php-fpm.pid`
Linux下PHP环境安装具体步骤,布布扣,bubuko.com
原文地址:http://blog.csdn.net/websites/article/details/36872713