Next make sure the following dependencies are installed. You can use 'yum install [package]' in order to install these:
curl-devel freetype-devel httpd httpd-devel libc-client libc-client-devel libjpeg-devel libmcrypt-devel libpng-devel libtool-ltdl-devel libxml2-devel mysql-develOnce the dependencies are installed unzip the php source with bzip2 using:
bzip2 -d php-5.3.0.tar.bz2Next untar the files using:
tar -xvf php-5.3.0.tarFinally change into the php-5.3 directory with:
cd php-5.3.0Now you have to configure the installation. You may need to customize some of the settings below, but the PHP build is pretty helpful about telling you what might have gone wrong. Use the following:
./configure --with-apxs2=/usr/sbin/apxs --with-mysqli=/usr/bin/mysql_config --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/lib --with-zlib --with-freetype-dir=/usr --enable-gd-native=ttf --with-ttf --with-curl --with-aspell --enable-mbstring --with-mcrypt=/usr/local --with-mhash=/usr/local --with-libxml-dir=/usr --enable-soap --enable-zip --with-imap --with-kerberos --with-imap-sslFinally you need to make the installation using:
make make installOnce PHP is built you have to create the PHP configuration file and adjust the Apache configuration files. First copy the sample php.ini configuration file using:
cp php.ini-production /usr/local/lib/php.iniYou'll probably want to link this file to its default location so you don't lose it:
ln -s /usr/local/lib/php.ini /etc/php.iniNext, edit the httpd.conf file to include 'index.php' as one of the default indexes using:
vi /etc/httpd/conf/httpd.confAnd alter the line:
DirectoryIndex index.php index.html index.html.varAnd make sure the following appears (you may need to add the second line):
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so AddType application/x-httpd-php .phpNow that everything is configured you should be able to restart Apache using:
/etc/rc.d/init.d/httpd restartOnce this is done edit a page called phpinfo.php in the web root using:
vi /var/www/html/phpinfo.phpAnd include the following lines:
Now browse to the URL of the server to check the PHP configuration (for example http://localhost/phpinfo.php).
source : madirish.net
Tidak ada komentar:
Posting Komentar