一. 脚本install的内容,将本脚本放在/user/local
执行./install apache_1.3.12 php-4.0.6 mysql-3.22.40
tar zxvf $1.tar.gz
tar zxvf $2.tar.gz
tar zxvf $3.tar.gz
mv $1 apache
mv $2 php
mv $3 mysql
cd mysql
./configure
make
make install
/usr/local/bin/mysql_install_db
echo "/usr/local/bin/safe_mysqld & " >> /etc/init.d/rc.local
/usr/local/bin/safe_mysqld &
cd ../apache
./configure
cd ../php
./configure --with-mysql=/usr/local --with-apache=/usr/local/apache --enable-track-vars
make
make install
cp libs/libphp4.a ../apache/src/modules/php4/libphp4.a
cd ../apache
./configure --activate-module=src/modules/php4/libphp4.a
make
make install
cd ../php
cp php.ini-dist /usr/local/lib/php.ini
二. 由于httpd.conf情况各异,请手工修改该文件中的三行
vi /usr/local/apache/conf/httpd.conf
# AddType application/x-httpd-php .php
改为
AddType application/x-httpd-php .php .php3 .htm .phtml .php4
# AddType application/x-httpd-php-source .phps
去掉开头的#
DirectoryIndex index.htm
改为
DirectoryIndex index.htm index.html index.php3 index.php default.php
三. 结束