at 2006-12-10
in PHP5
by kiesel
(0 comments)
RFC #0092 is about the strategy that the XP framework will follow when doing it's step to PHP5 - from the strategic point of view.
It's quite obvious that 3rd party applications cannot be run under a 5.xx version of XP from one day to the other (well, actually it could, but the problem here is that quite a number of applications exist and you cannot take care for them all at a single moment), so systems need to provide a backwards compatible way of doing this step.
What that means is: we need to be able to run PHP4 and PHP5 on the same host, as CLI and in a web environment.
The setup, this article is going to feature is having PHP4 as a Apache module and PHP5 as CGI.I consider this setup the most logical at the moment: most users already have a PHP4 module set up, so we just do the add-on. Gentoo-users can relex as their package management already does everthing for them. They can jump over to Configure Apache to work with PHP4 and PHP5.
Doing that manually involves the following steps: 1. Compile PHP Assumed the package management won't let you install PHP4 along with PHP5, we'll just compile it ourselves. On a system with dev-files installed, it should be sufficient easy:
php5@php3:~/php-5.2.0# ./configure --with-sybase-ct=/usr/local --with-mysql \ --enable-cgi --prefix=/home/php5/chroot
I used a separate user and recommend it for clear separation of files. Once configure and make have finished, issue a make install and all files will be installed into ~/chroot of user php5. (I recommend not to install into /usr/local or you'll never be able to cleanly remove the files)
2. Configure Apache to provide optional PHP5 support Into the already configured Apache add the following directives to add support for PHP5:
# Setup for PHP5CGI ScriptAlias /php5-cgi /home/php5/chroot/bin/php Action php5-cgi /php5-cgi
# This might be optional: <Directory "/home/php5/chroot"> Allow from all </Directory>
This configuration does not really change anything. This is only the general setup.
If you want to switch one single virtualhost to PHP5, see the next step.
3. Switch virtualhost(s) to PHP5 Add the AddHandler directive into the virtualhost:
Addhandler php5-cgi .php
You could also choose not to overwrite the .php settings and instead use .php5 to intermix PHP4 and PHP5 in a single virtualhost.
The name "php5-cgi" is also just a self-chosen name that only needs to be unique and consistent throughout the Apache configuration.
Keep in mind that you cannot change PHP settings with php_value as that is a mod_php Apache directive. How to change options can be read about here.
That's it. Once enough (all) applications run PHP5, you can drop PHP4 support, remove mod_php4 and switch to mod_php5 by means of the package management system.
|
Subscribe
You can subscribe to the XP framework's news by using RSS syndication.
CategoriesNews General PHP5 Announcements RFCs Further reading Examples Editorial EASC Experiments Unittests Databases
RelatedFind related articles by a search for «Running».
|