unzip php-5.2.2.zip
cd php-5.2.2
chmod +x configure
./configure --prefix=/usr/local/php5.2.2 --enable-mbstring --enable-sockets --enable-soap --enable-zip --enable-pdo --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib --with-config-file-path=/usr/local/php5.2.2/lib --with-pdo-mysql=/usr/local/mysql --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config
make
chmod -R 755 .
make install
cp php.ini-recommended /usr/local/php5.2.2/lib/php.ini
sed -i s/short_open_tag\ =\ OFF/short_open_tag\ =\ ON/ /usr/local/php5.2.2/lib/php.ini
给Apache添加php支持:
echo "AddType application/x-httpd-php .php">> /usr/local/apache2/conf/httpd.conf
echo "AddType application/x-httpd-php-source .phps">> /usr/local/apache2/conf/httpd.conf
还要在httpd.conf中添加index.php
cd /usr/local/apache2/bin/
./apachectl restart
阅读(1161) | 评论(0) | 转发(0) |