Linux under the PHP environment installationyou need the following installation packages:
1. Font engine, freetype-2.1.10.tar.gz
2. JPEG Graphics library, jpegsrc.v6b.tar.gz
3. PNG graphics library, libpng-1.2.8-config.tar.gz
4. Data compression library, zlib-1.2.3.tar.gz
5. Encryption algorithm extension library, libmcrypt-2.5.7.tar.gz
6. PHP Source Package, Php-5.3.3.tar.gz6
Make sure that your installation of the Linux environment already has the default package installed:
Yum install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*
to create an installation folder for an extended Lib file
sudo mkdir –p /usr/local/web sudo mkdir- p /usr/local/web/lib #存放扩展lib目录
Install data compression library zlib, installation directory:/usr/local/web/lib/zlib
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>
Install the JPEG graphics library, install directory:/usr/local/web/lib/jpeg
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
PNG graphics library, installation directory:/usr/local/web/lib/libpng
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
font engine, installation directory:/usr/local/web/lib/freetype
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
encryption algorithm extension library, installation directory:/usr/local/web/lib/libmcrypt
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
Install PHP
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
we have prepared two php.ini profiles and php-fpm.conf configuration files, and the default configuration is generally not sufficient for our needs (if you don't have one, you don't need to copy). Copy the configuration file
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 /
set the maximum number of connections for Linux, which is 1024 by default. Set to higher under high load, but only up to 65535. Due to failure after reboot, can be joined/etc/rc.d/rc.local boot
Ulimit-shn 65535 start php fpm process [plain] view plaincopyprint?/usr/local/web/php.5.3.3/sbin/php-fpm view PHP fpm Process [Plain] View Plaincopyprint?ps–ef | grep php-fpm #查看PHP进程 Management 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 '
Thank you for your attentionWebsitesBlog!