自行編譯 php4
作者: cross 日期: 2006-11-04 16:42
1.
apt-get install flex httpd-devel
2.
tar zxvf php-4.4.1.tar.gz
cd php-4.4.1
3.
./configure --with-apxs2=/usr/sbin/apxs --with-mysql --with-gd --with-zlib-dir --with-jpeg-dir --with-png-dir
make
make install
註:
'--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
4.
cp php.ini-dist /usr/local/lib/php.ini
5. 把對php5的設定註解
vi /etc/httpd/conf.d/php.conf
#LoadModule php5_module modules/libphp5.so
LoadModule php4_module libexec/libphp4.so
#AddHandler php5-script .php
#AddType text/html .phpAddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
6.
service httpd graceful
[Q1.] [root@router html]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Wed Jan 04 00:05:20 2006] [warn] module php4_module is already loaded, skipping
[ OK ]
[root@router html]#
[A1.] 在/etc/httpd/conf.d/php.conf與/etc/httpd/conf/httpd.conf的php4_module互相衝突了,註解掉/etc/httpd/conf.d/php.conf中的php4_module
[Q2.] ./configure
checking lex output file root... ./configure: line 2540: lex: command not found
configure: error: cannot find output from lex; giving up
[A2.] apt-get install flex
[Q3.]
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking for mod_charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /usr/sbin/apxs follows:
./configure: line 5656: /usr/sbin/apxs: No such file or directory
[A3.] apt-get install httpd-devel
[Q4.]
checking for GD support... yes
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 1.x support... no
checking for FreeType 2... no
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.
[A4.] apt-get install libpng-devel
上一篇
返回
下一篇
標籤:




php安全性比較好的作法 (2011-12-03 23:17)
Apache Range Header DOS 攻擊讓主機資源輕易消秏待盡 (2011-09-15 21:01)
apache強制某路徑使用https方式連線 (2011-06-26 16:31)
apahce module模組--mod_pagespeed -- Google出的,用來優化網頁 (2011-04-20 09:45)
關閉apache與php版本顯示 (2011-02-08 12:19)
Apache + mod_security 網站應用程式防火牆阻擋攻擊(WAF) (2010-11-30 16:59)
apache 搭配 mod_write 來得知是不是透過手機來瀏覽網站的 (2010-10-29 15:44)
Apache 使用 mod_php 讓 VH 有獨立的 php.ini 檔 (2009-02-06 10:34)
Apache + 可以限制 .htaccess 只能使用某些參數嗎 (2009-02-02 18:52)