Upgrading PHP


Given that UNIX/Linux users can add so much functionality to PHP through various build options, it is likely that you will upgrade or modify PHP more often than Apache or MySQL. Regardless of whether you are upgrading to a new minor version or simply adding new functionality (or removing some you no longer need), the process for modifying an existing version is exactly the same as installing it in the first place: configure, make, make install. The make install step places the PHP module in the appropriate place in the Apache directory tree. When your new module is in place, restart Apachethe new version of PHP should be in use.

If you are upgrading to a new minor version of PHP, when you extract the distribution archive you will have a completely distinct directory tree, based on the version number. Perform the configure, make, make install steps within this new directory structure, and a new PHP module will be built, independent of the other.

Windows users have a different set of tasks to perform; adding new functionality to an existing module requires only that the module be activated by uncommenting its entry in php.ini and restarting Apache. Upgrading to a new minor version requires you to download a new distribution file. The contents of this file are then extracted into a directory named for the version it represents. You must then follow the steps required for installation, regarding the configuration of php.ini, because each version produces a different file. Finally, change any PHP-related pathnames in the Apache httpd.conf file and restart the serverthe new version of PHP should be in use.

Using PECL and PEAR to Extend PHP

A wealth of user-created extensions and applications can be obtained from PECL (the PHP Extension Community Library, at http://pecl.php.net/) and PEAR (the PHP Extension and Application Repository, at http://pear.php.net/). These sites are governed by rules and style guides, so anything you download from these sites will be of high quality.

If you are looking for additional extensions for your PHP installation, look to PECL. If you are looking for a library of open source code to integrate in your application, look to PEAR.




Sams Teach Yourself PHP, MySQL And Apache All in One
Sams Teach Yourself PHP, MySQL and Apache All in One (3rd Edition)
ISBN: 0672328739
EAN: 2147483647
Year: 2004
Pages: 327

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net