不知这个可不可以你试试看.
Linux+Apache1.3.12+PHP4.0RC1+GD+JPEG+PNG安装脚本关键词:PHP, LINUX#please first install jpeg and gd
##----where to download----
#http://www.apache.org/dist/apache_1.3.12.tar.gz
#http://www.php.net/version4/downloads/php-4.0RC1.tar.gz#----version variables----
ver_apache=apache_1.3.12
ver_php=php-4.0RC1#----src of modules----
module_src_php=src/modules/php4/libphp4.a#----php configuration in httpd.conf----
httpd_conf_php="AddType application/x-httpd-php .php"
httpd_conf_php_source="AddType application/x-httpd-php-source .phps"#----preinstalled library----
jpeg=/usr/local/jpeg
gd=/usr/local#----installation directories----
apache=/usr/local/apache
php=/usr/local/php#----how to test php----
howto_test_php="how to test php? write a file named phpinfo.php in ${apache}/htdocs/ whose content is 
after apache started,type http://localhost/phpinfo.php in browser,just search gd,if 
you can find words like gd Version 1.6.2 or higher which supports PNG,php supports gd."#----how to start or stop apache----
howto_start_apache="how to start apache? type ${apache}/bin/apachectl start."
howto_stop_apache="how to stop apache? type ${apache}/bin/apachectl stop."#----untar----
tar xzvf ${ver_php}.tar.gz
tar xzvf ${ver_apache}.tar.gz#----prepare to install----
cd $ver_apache
./configure
cd ..#----install php----
cd $ver_php
./configure --prefix=$php --with-apache=../$ver_apache --with-config-file-path=$php --enable-track-vars
--with-gd=$gd --with-jpeg-dir=$jpeg
make
make install
cp php.ini-dist $php/php.ini
cd ..#----install apache----
cd $ver_apache
./configure --prefix=$apache --activate-module=$module_src_php
make
make install
cd ..#----free----
rm -rf $ver_php
rm -rf $ver_apache#----configuration infomation----
echo "------------------------------------------------------------------------"
echo "please make sure following lines exist in ${apache}/conf/httpd.conf:"
echo " $httpd_conf_php"
echo " $httpd_conf_php_source"
echo ""
echo $howto_test_php
echo ""
echo $howto_start_apache
echo $howto_stop_apache

解决方案 »

  1.   

    请问我配置完PHP,在make的时候出现如下错误,我该怎么办?
    Making all in Zend
    make[1]: Entering directory `/usr/php-4.2.3/Zend'
    lex -Pzend -S./flex.skl -ozend_language_scanner.c -i ./zend_language_scanner.l
    0: Warning: 1285-300 The P flag is not valid.
    0: Warning: 1285-300 The z flag is not valid.
    0: Warning: 1285-300 The e flag is not valid.
    0: Warning: 1285-300 The d flag is not valid.
    0: Warning: 1285-300 The S flag is not valid.
    0: Warning: 1285-300 The . flag is not valid.
    0: Warning: 1285-300 The / flag is not valid.
    0: Warning: 1285-300 The f flag is not valid.
    0: Warning: 1285-300 The l flag is not valid.
    0: Warning: 1285-300 The e flag is not valid.
    0: Warning: 1285-300 The x flag is not valid.
    0: Warning: 1285-300 The . flag is not valid.
    0: Warning: 1285-300 The s flag is not valid.
    0: Warning: 1285-300 The k flag is not valid.
    0: Warning: 1285-300 The l flag is not valid.
    0: Warning: 1285-300 The o flag is not valid.
    0: Warning: 1285-300 The z flag is not valid.
    0: Warning: 1285-300 The e flag is not valid.
    0: Warning: 1285-300 The d flag is not valid.
    0: Warning: 1285-300 The _ flag is not valid.
    0: Warning: 1285-300 The l flag is not valid.
    0: Warning: 1285-300 The a flag is not valid.
    0: Warning: 1285-300 The g flag is not valid.
    0: Warning: 1285-300 The u flag is not valid.
    0: Warning: 1285-300 The a flag is not valid.
    0: Warning: 1285-300 The g flag is not valid.
    0: Warning: 1285-300 The e flag is not valid.
    0: Warning: 1285-300 The _ flag is not valid.
    0: Warning: 1285-300 The s flag is not valid.
    0: Warning: 1285-300 The a flag is not valid.
    0: Warning: 1285-300 The e flag is not valid.
    0: Warning: 1285-339 Ratfor is not supported with lex.
    0: Warning: 1285-300 The . flag is not valid.
    0: Warning: 1285-300 The i flag is not valid.
    919: Error: 1285-302 The parse tree is too large.
            Try using the following: %e Number
    make[1]: *** [zend_language_scanner.c] Error 1
    make[1]: Leaving directory `/usr/php-4.2.3/Zend'
    make: *** [all-recursive] Error 1