In my work PHP is a required part of most, if not all web sites I help with; especially Drupal. Here are tips I've collected along the way and of course YMMV (your mileage may vary).
PHP Tuning
- Utilize Op-code caching like APC, eAccelerator, Xcache, or Zend Accelerator. APC has been reported as the most stable and has good performance.
- Run PHP in FastCGI (FCGI) mode versus regular CGI methods, if possible. FCGI uses a socket to the PHP process, not forking.
- Disable PHP extensions not needed.
- Disable debug and development extensions on production and staging servers.
APC (Alternative PHP Cache)
The Alternative PHP Cache (APC) is a free and open op-code cache for PHP. The behavior of these functions is affected by settings in php.ini. The bundled apc.php script provides a detailed analysis of how APC is working.
- Increase apc.shm_size higher than the default 30MB. Drupal sites can use 64MB or higher.
- Enable apc.enable_cli to help speed up PHP scripts that run via the command line.
- Use apc.filters to exclude file extensions that should not be cached by APC.
- Disable apc.stat for a boost, but new files or updated files will not be recognized unless the APC cache is rebuilt.
- Enble apc.include_once_override but be warned updated and new files may not be cached until APC is flushed.
- Enabling apc.rfc1867 provides upload progress data to PHP, giving better user experiences on web pages during large file uploads.





















