How to upgrade to PHP5.x and Apache 2.X

source: http://www.directadmin.com/forum/showthread.php?s=78bb4e8b8b5deb41fdc7275bb87a051a&threadid=13173&perpage=20&pagenumber=1

http://www.directadmin.com/forum/showthread.php?s=70864a5c335e7705f268e661e0a6d78f&threadid=14285

cd /usr/local/directadmin/customapache<br />rm -fr build<br />wget http://files.directadmin.com/services/customapache/build<br />chmod 755 build<br />./build update<br />./build clean<br />./build update_data_ap2<br />perl -pi -e 's/2.0.59/2.2.6/' build

or manually change any reference to old version to new (this is best way, above will get outdated)

#vi ./build

change APACHE and PHP references according to the version downloaded below.

<br />wget <a href="http://www.reverse.net/pub/apache/httpd/httpd-2.2.4.tar.gz" mce_href="http://www.reverse.net/pub/apache/httpd/httpd-2.2.6.tar.gz">http://www.reverse.net/pub/apache/httpd/httpd-2.2.6.tar.gz</a><br />wget <a href="http://us2.php.net/get/php-5.2.4.tar.gz/from/this/mirror" mce_href="http://us2.php.net/get/php-5.2.4.tar.gz/from/this/mirror">http://us2.php.net/get/php-5.2.4.tar.gz/from/this/mirror</a><br />./build apache_2<br />./build php_ap2 n if you get xml error do this:<br /># yum install libxml2-devel

next... edit httpd.conf

vi /etc/httpd/conf/httpd.conf

comment out:

#LoadModule php4_module modules/libphp4.so

add:

LoadModule php5_module modules/libphp5.so

add ".php5" to this line:

AddType application/x-httpd-php .inc .php .php5 .php4 .php3 .phtml

(see here for more help)

<br />./build mod_perl_ap2<br />./build zend (optional)<br />/sbin/service httpd restart

Install/Update eaccelerator:

cd /ea<br />rm -rf ./eaccelerator* <br />rm -rf /usr/local/lib/php/extensions/no-debug-non-zts-* <br />wget http://bart.eaccelerator.net/source/0.9.6/eaccelerator-0.9.6.tar.bz2<br />tar xvfj eaccelerator-0.9.6.tar.bz2<br />cd eaccelerator-0.9.6<br />export PHP_PREFIX="/usr/local" <br />$PHP_PREFIX/bin/phpize <br />./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config <br />make<br />make install<br />cd /tmp<br />rm -fr /tmp/eaccelerator<br />mkdir /tmp/eaccelerator<br />chmod 0777 /tmp/eaccelerator<br />vi /usr/local/lib/php.ini

Add/Edit right after "Windows Extensions":

zend_extension="/ea/eaccelerator-0.9.6/modules/eaccelerator.so"  
eaccelerator.shm_size="32"  
eaccelerator.cache_dir="/tmp/eaccelerator"  
eaccelerator.enable="1"  
eaccelerator.optimizer="1"  
eaccelerator.check_mtime="1"  
eaccelerator.debug="0"  
eaccelerator.filter=""  
eaccelerator.shm_max="0"  
eaccelerator.shm_ttl="0"  
eaccelerator.shm_prune_period="0"  
eaccelerator.shm_only="0"  
eaccelerator.compress="1"  
eaccelerator.compress_level="9"
Tags: Linux apache how-to PHP