18.2 Tuning PHP


Tuning PHP is much harder than tuning the database because scripts are always executed the same way. However, some basic things can be changed to achieve higher performance. In this section you will see what can be done to make PHP run even faster.

PHP can be used in two ways: One way is to run PHP as a Web server module so that it is called by Apache. The other way is to run PHP using the CGI interface. When you use the CGI interface, a process is started whenever a request is sent to the Web server. When the process is started, php.ini has to be read so that PHP can find out which parameters have been set. This takes some time and can cause significant overhead. After that the script is executed.

In the case of PHP as a module, php.ini does not have to be parsed and analyzed for every connection being established to the database. Therefore PHP is significantly faster when using it as a module.



PHP and PostgreSQL. Advanced Web Programming2002
PHP and PostgreSQL. Advanced Web Programming2002
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 201

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