使用php需要安裝一些依賴
安裝libxml2
cd /export/software/
tar zxvf libxml2-2.7.2.tar.gz
cd libxml2-2.7.2
./configure --prefix=/usr/local/libxml2 \
--without-zlib
make && make install
安裝jpeg8
cd /export/software/
tar -zxvf jpegsrc.v8b.tar.gz
cd jpeg-8b
./configure --prefix=/usr/local/jpeg \
--enable-shared --enable-static
make && make install
#--enable-shared 把jpeg需要的函數庫程序都編譯到該軟件裏邊
優點:函數調用速度快
缺點:軟件本身比較大
#--enable-static 靜態方式函數處理,需要什麼函數,馬上include來
優點:軟件本身比較小
缺點:函數調用速度慢
安裝libpng
cd /home/jinnan/tar
tar zxvf libpng-1.4.3.tar.gz
cd libpng-1.4.3
./configure #和zlib一樣不要帶參數
make && make install
安裝freetype(字體庫)
cd /export/software/
tar zxvf freetype-2.4.1.tar.gz
cd freetype-2.4.1
./configure --prefix=/usr/local/freetype
make && make install
安裝GD庫
cd /home/jinnan/tar
tar -zvxf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure --prefix=/usr/local/gd \
--with-jpeg=/usr/local/jpeg/ \
--with-png --with-zlib \
--with-freetype=/usr/local/freetype
make && make install
安裝 php5
shell># cd /home/jinnan/tar
shell># tar -jxvf php-5.3.6.tar.bz2
shell># cd php-5.3.6
shell>#./configure --prefix=/usr/local/php \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-freetype-dir=/usr/local/freetype \
--with-gd=/usr/local/gd \
--with-zlib --with-libxml-dir=/usr/local/libxml2 \
--with-jpeg-dir=/usr/local/jpeg \
--with-png-dir \
--enable-mbstring=all \
--enable-mbregex \
--enable-shared \
--with-openssl \
--enable-fpm \
--with-config-file-path=/usr/local/php/etc \
--with-curlwrappers
make && make install
複製php.ini配置文件到指定目錄
shell># cp php.ini-development /usr/local/php/etc/php.ini
shell># cd /usr/local/php/etc
shell># cp ./php-fpm.conf.default ./php-fpm.conf
啓動php服務
shell># /usr/local/php/sbin/php-fpm
關閉php服務
shell># killall php-fpm
錯誤:
修改php-fpm.conf
去掉配置前的 ” ; ”
pm.min_spare_servers=5
pm.max_spare_servers=35
pm.start_servers=20
然後殺死進程重新啓動,查看端口
ps aux | grep php