Download presentation
Presentation is loading. Please wait.
Published byHoward Clarke Modified over 9 years ago
1
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
2
Download & Install LibXML, LibSLT 1/2 Download latest LibXML and LibSLT Install libxml2 # cd /usr/local/src # wget http://xmlsoft.org/sources/libxml2-2.6.23-1.i386.rpm # wget http://xmlsoft.org/sources/libxml2-devel-2.6.23-1.i386.rpm # wget http://xmlsoft.org/sources/libxml2-python-2.6.23-1.i386.rpm # wget http://xmlsoft.org/sources/libxslt-1.1.15-1.i386.rpm # wget http://xmlsoft.org/sources/libxslt-devel-1.1.15-1.i386.rpmhttp://xmlsoft.org/sources/libxslt-devel-1.1.15-1.i386.rpm # wget http://xmlsoft.org/sources/libxslt-python-1.1.15-1.i386.rpm # cd /usr/local/src # wget http://xmlsoft.org/sources/libxml2-2.6.23-1.i386.rpm # wget http://xmlsoft.org/sources/libxml2-devel-2.6.23-1.i386.rpm # wget http://xmlsoft.org/sources/libxml2-python-2.6.23-1.i386.rpm # wget http://xmlsoft.org/sources/libxslt-1.1.15-1.i386.rpm # wget http://xmlsoft.org/sources/libxslt-devel-1.1.15-1.i386.rpmhttp://xmlsoft.org/sources/libxslt-devel-1.1.15-1.i386.rpm # wget http://xmlsoft.org/sources/libxslt-python-1.1.15-1.i386.rpm # cd /usr/local/src # rpm -e --nodeps libxml2-2.6.17-4 # rpm -ivh libxml2-2.6.23-1.i386.rpm # rpm -ivh libxml2-devel-2.6.23-1.i386.rpm # rpm -ivh libxml2-python-2.6.23-1.i386.rpm # cd /usr/local/src # rpm -e --nodeps libxml2-2.6.17-4 # rpm -ivh libxml2-2.6.23-1.i386.rpm # rpm -ivh libxml2-devel-2.6.23-1.i386.rpm # rpm -ivh libxml2-python-2.6.23-1.i386.rpm
3
Download & Install LibXML, LibSLT 2/2 Install libxslt libgcrypt-devel is needed by libxslt-devel-1.1.15-1, installed with yast! Then install libxslt-devel Verify that packages were installed proper # rpm -e --nodeps libxslt-1.1.12-5 # rpm -ivh libxslt-1.1.15-1.i386.rpm # rpm -e --nodeps libxslt-1.1.12-5 # rpm -ivh libxslt-1.1.15-1.i386.rpm # rpm -qa | grep libxml2 libxml2-2.6.23-1 libxml2-devel-2.6.23-1 # rpm -qa | grep libxslt libxslt-1.1.15-1 libxslt-devel-1.1.15-1 # rpm -qa | grep libxml2 libxml2-2.6.23-1 libxml2-devel-2.6.23-1 # rpm -qa | grep libxslt libxslt-1.1.15-1 libxslt-devel-1.1.15-1 # rpm -ivh libxslt-devel-1.1.15-1.i386.rpm
4
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 http://se.php.net/get/php-5.1.2.tar.gz/from/this/mirror # cd /usr/local/src # wget http://se.php.net/get/php-5.1.2.tar.gz/from/this/mirror # cd php-5.1.2 #./configure --with-mysql=/usr --with-apxs2 --with-sqlite # cd php-5.1.2 #./configure --with-mysql=/usr --with-apxs2 --with-sqlite cd /usr/local/src tar xvfz php-5.1.2.tar.gz cd /usr/local/src tar xvfz php-5.1.2.tar.gz # make
5
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: Find AddType in Apache config file and add: # make install Options Indexes FollowSymLinks Includes MultiViews # libtool --finish /usr/local/src/php-5.1.2/libs DirectoryIndex index.html index.html.var index.php LoadModule php5_module lib/httpd/modules/libphp5.so AddType application/x-httpd-php.php AddType application/x-httpd-php-source.phps AddType application/x-httpd-php.php AddType application/x-httpd-php-source.phps
6
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 Create a small start/stop script for apache! Make Apache and MySQL start at boot time We are now done! You should now have lastest version of: –ApacheMySQLPHP5 Check that Apache can deal with PHP5 code. –Add to /usr/local/httpd/htdocs/test.php –Test to open: http://www.my-site.com/test.php # /etc/init.d/mysql restart # chkconfig mysql on # chkconfig httpd on # chkconfig mysql on # chkconfig httpd on # apachectl restart <? phpinfo(); ?> <? phpinfo(); ?>
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.