Program
I've always thought PHP was a very fast running speed, especially after the Zend engine accelerated. But PHP still has the possibility of acceleration, you know?
Everything starts with how to optimize PHP's compilation
Attempt to use a special compilation parameter for the CPU model-msse-mmmx-mfpmath=sse
Add-03 parameter at compile time
Adjust CPU parameters When compiling-MARCH-MCPU use Caution
Try to compile only the modules you need to avoid unwanted extended loading
For the less-used extension module, it should be compiled into a shared mode to facilitate dynamic loading at run time.
Maybe sometimes--disable-all will be your best friend.
PHP statically compiled to Apache can speed up 20%
# PHP
./configure--with-apache=/path/to/apache_source
# Apache
./configure--activate-module=src/modules/php4/libphp4.a
Optimize your PHP configuration file
Confirm that your register_globals configuration is disabled
Disable magic_quotes_* option
Close expose_php
Close REGISTER_ARGC_ARGV
Do not enable always_populate_raw_post_data unless absolutely necessary
Optimal configuration of Apache server
Maxspareservers with high configuration
MaxClients set to 2/5 that your server can withstand
The ideal situation for Maxrequestsperchild is 0 (not limited), but is actually set to a more than one value
Optimizing File Access
DirectoryIndex file list as short as possible
In any case prohibit the allowoverridenone of the. htaccess file
Using FollowSymLinks to simplify file access processing
Avoid using mod_rewrite or more complex operations
Disable if the log is not necessary
If you must use a log, record it in a file and clear it after parsing
Eliminate expensive system calls
Don't open extendedstatus.
Use IP instead of domain name when you allow and disallow rules
Do not enable hostnamelookups
Keep Serversignature off
Set KeepAlive to a smaller value
Dynamic and static content separation
Improve hard Drive performance parameters
Use output_buffering to optimize the interaction between PHP and Apache
Increase the sendbuffersize size of Apache
Improve cache execution
Using the PHP code caching mechanism
Turck MMCache Stop developing
APC is slow and not optimized
Zend Cache optimization performance is good, but pay
Ioncube PHP Accelerator free but not open source
If you can use zlib compression
Reduce output data
Replace HTML with CSS
Compress HTML pages
Using Sessions Management
Optimize your SQL command