Installation of PHP5 Objectives –Install PHP5 with support for Apache and MySQL Contents –Installing latest dependencies LibXML & LibSLT –Compiling and installing PHP5 for MySQL & Apache –Configure PHP5 –Add PHP support in Apache Practical –Install PHP5 Summary
Download & Install LibXML, LibSLT 1/2 Download latest LibXML and LibSLT Install libxml2 # cd /usr/local/src # wget # wget # wget # wget # wget # wget # cd /usr/local/src # wget # wget # wget # wget # wget # wget # cd /usr/local/src rpm -Uvh --nodeps libxml i386.rpm rpm -Uvh libxml2-devel i386.rpm rpm -Uvh libxml2-python i386.rpm # cd /usr/local/src rpm -Uvh --nodeps libxml i386.rpm rpm -Uvh libxml2-devel i386.rpm rpm -Uvh libxml2-python i386.rpm
Download & Install LibXML, LibSLT 2/2 Install libslt Verify that packages were installed proper # rpm -Uvh libxslt i386.rpm # rpm -qa | grep libxml2 libxml2-python libxml libxml2-devel # rpm -qa | grep libxslt libxslt # rpm -qa | grep libxml2 libxml2-python libxml libxml2-devel # rpm -qa | grep libxslt libxslt
Download & Unzip & compile PHP5 Download PHP5 sources Unzip PHP5 sources in /usr/local/src Configure PHP5 Compile PHP5 source –Note that compiling PHP5 can take 15 to 90 minutes or more # cd /usr/local/src # wget # cd /usr/local/src # wget # cd php #./configure --with-mysql=/usr --with-apxs2 --with-sqlite # cd php #./configure --with-mysql=/usr --with-apxs2 --with-sqlite cd /usr/local/src tar xvfz php tar.gz cd /usr/local/src tar xvfz php tar.gz # make
Installing & Configuring PHP5 1/2 Installing PHP5 binaries Add PHP5 libraries to libpath in /etc/ld.so.conf Find section LoadModule in Apache config file and add after last LoadModule: Find in Apache config file and change first Options line to: Find DirectoryIndex in Apache config file and change to: # make install Options Indexes FollowSymLinks Includes MultiViews # libtool --finish /usr/local/src/php-5.0.3/libs DirectoryIndex index.html index.html.var index.php LoadModule php5_module lib/httpd/modules/libphp5.so
Start MySQL and Apache services! Restart Apache –Check logfiles for any error: tail /var/log/httpd/access_log Restart MySQL –Check logfiles for any error: tail /var/log/messages Make Apache and MySQL start at boot time We are now done! You should now have lastest version of: –Apache –MySQL –PHP5 Look in PHP5 study book install chapter howto verify your server operation! # service mysql restart # chkconfig httpd on # chkconfig mysql on # chkconfig httpd on # chkconfig mysql on # service mysql restart