php安裝:
網站推廣
1./configure --prefix=/usr/local/php --with-apxs2=/home/apache/bin/apxs --with-zlib-dir --with-libxml-dir=/usr/local/libxml2/ --with-gd --with-freetype --with-jpeg --with-png --enable-mbstring --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-gd-native-ttf --with-gettext=/usr/local/gettext/ --enable-magic-quotes --enable-sockets
須要php支持圖片須要gd庫
因爲操做系統自帶了gd png jpeg 庫等,無法指定dir 直接用--with-jpeg這樣的形式。
2.make install時出現如下錯誤:
Installing PHP SAPI module: apache2handler
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' libphp5.la /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install cp libphp5.la /usr/lib/apache2/modules/
libtool: install: cp .libs/libphp5.so /usr/lib/apache2/modules/libphp5.so
libtool: install: cp .libs/libphp5.lai /usr/lib/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/hcc/php-5.2.13/libs'
chmod 644 /usr/lib/apache2/modules/libphp5.so
apxs:Error: Activation failed for custom /etc/apache2/httpd.conf file..
apxs:Error: At least one `LoadModule' directive already has to exist..
make: *** [install-sapi] Error 1
實際上httpd.conf已經存在。不知道爲何出現以上錯誤,採用瞭如下方法,先備份httpd.conf
而後從新建一個httpd.conf
內容
#LoadModule directive to aid module installations
#LoadModule dummy_module /usr/lib/apache2/modules/mod_dummy.so
這樣就成功安裝
3.解決了php安裝後,發現php不支持jpeg,可是在上述的配置過程當中已經加上了--with-jpeg,而且libjpeg的rpm也是安裝的,可是始終是沒法支持,只好從新安裝jpeg庫
下載jpegv6
ftp://ftp.sunfreeware.com/pub/freeware/SOURCES/jpeg-6b.tar.gz
編譯安裝:./configure --prefix=/usr/local/jpeg --enable-shared
而後在安裝php
/configure --prefix=/usr/local/php --with-apxs2=/home/apache/bin/apxs --with-zlib-dir --with-libxml-dir=/usr/local/libxml2/ --with-gd --with-freetype --with-jpeg-dir=/usr/local/jpeg --with-png --enable-mbstring --with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-gd-native-ttf --with-gettext=/usr/local/gettext/ --enable-magic-quotes --enable-sockets
從新編譯安裝便可支持
網站推廣jpeg(fblww-0308)