I always think that PHP runs very quickly, especially after Zend engine acceleration. But PHP still has the possibility of acceleration, you know?
Everything starts with how to optimize PHP compilation.
Try to use the special compilation parameter-msse-mmmx-mfpmath = sse for the CPU Model
Add the-03 parameter during compilation
Adjust the CPU parameter-march-mcpu Use Caution during compilation
Try to compile only the modules you need to avoid useless extension loading.
For extended modules that are rarely used, the shared mode should be compiled to facilitate dynamic loading during running.
Sometimes -- disable-all will be your best friend.
PHP static compilation to Apache can be accelerated by 20%
# PHP
./Configure -- with-apache =/path/to/apache_source
# Apache
./Configure -- activate-module = src/modules/php4/libphp4.a
Optimize Your PHP configuration file
Make sure your register_globals is configured as disabled
Disable magic_quotes _ *
Disable expose_php
Disable register_argc_argv
Unless absolutely required, do not enable always_populate_raw_post_data
Optimization Configuration of Apache server
Use high configuration for MaxSpareServers
Set MaxClients to 2/5 that your server can afford
MaxRequestsPerChild is ideally 0 (not limited), but is actually set to a larger value.
Optimize File Access
The DirectoryIndex file list is as short as possible.
No matter how you disable AllowOverridenone of the. htaccess File
Use FollowSymLinks to simplify File Access Processing
Avoid mod_rewrite or more complex operations
Disable logs if they are not required.
If logs must be used, record them to a file and clear them after analysis.
Eliminate expensive system calls
Do not enable ExtendedStatus
Use IP addresses instead of domain names when rules are allowed and prohibited
Do not enable HostnameLookups
Disable ServerSignature
Set KeepAlive to a smaller value.
Dynamic and Static content Separation
Improves hard disk Performance Parameters
Use output_buffering to optimize the interaction between PHP and Apache
Increase the SendBufferSize of Apache
Improve cache execution
Use PHP code caching mechanism
Turck MMCache stops development
APC is slow and not optimized enough
Zend Cache has good performance optimization but is charged
IonCube PHP Accelerator is free but not open-source
If you can use Zlib for compression
Reduce output data
Replacing HTML with CSS
Compressing HTML pages
Use Sessions Management
Optimize Your SQL commands