There are upcoming maintenance events which may impact our services. Lær mer

Install PHP4 on CentOS 5.5 VPS Skriv ut

  • 3

1. Install Apache

yum install httpd

2. Install Mysql

yum install mysql mysql-server php-mysql



3. Install dependencies

yum install flex gcc* bison bison-devel httpd-devel make

4. Download PHP4 cource

wget http://lu2.php.net/get/php-4.4.9.tar.gz/from/my2.php.net/mirror



5. Extract PHP4

tar zxvf php-4.4.9.tar.gz



6. Enter folder and configure

cd php-4.4.9
./configure --with-apxs2=/usr/sbin/apxs

7. Install and verify

make
make test

8. Finalise installation

make install

9. Add configuration to php.conf

nano /etc/httpd/conf.d/php.conf

add this to the file and save the file

# /etc/httpd/conf.d/php.conf
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages
#
LoadModule php4_module modules/libphp4.so
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncommenting the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps

10. Restart Apache

service httpd restart

Reference: http://www.thegeekstuff.com/2008/09/how-to-install-or-upgrade-lamp-apache-mysql-and-php-stack-on-linux-using-yum/


Var dette svaret til hjelp?

« Tilbake