1. Upgrade PHP to the latest version.
The simplest way to improve performance is to constantly upgrade and update the PHP version.
2. Use Analyzer
There are many reasons for slow website operation, Web ApplicationsProgramExtremely complex and confusing. One possibility is that PHPCodeItself. This analyzer can help you quickly identify the code that causes the bottleneck and improve the overall performance of the website.
Xdebug PHP extension provides powerful functions for debugging and code analysis. This allows developers to directly track the execution of scripts and view comprehensive data in real time. You can also import the data to the visualized tool kcachegrind.
3. Error Report
PHP supports powerful error detection functions to help you check errors in real time, from important errors to relatively small running prompts. A total of 13 independent report levels are supported. You can generate custom detection reports based on these levels.
4. Use PHP Extension
For a long time, everyone has complained that PHP content is too complicated. In recent years, developers have made corresponding efforts to remove some redundant features in the project. Even so, the number of available libraries and other extensions is considerable. Some developers have even begun to consider implementing their own scaling solutions.
5. Use the PHP accelerator
Generally, PHP scripts are compiled and executed by the PHP engine, and are converted into machine languages, also known as Operation codes. If PHP scripts get the same results after repeated compilation, why not skip the compilation process completely?
With the PHP accelerator, you can achieve this completely. It caches the machine code compiled by the PHP script and allows the code to be executed immediately as required without tedious compilation.
For PHP developers, there are currently two available cache solutions: APC (Alternative PHP cache, optional PHP cache ), it is an open-source accelerator that can be installed through pear. Another popular solution is Zend server, which not only provides the operation code caching technology, but also provides cache tools for corresponding pages.
6. Avoid high-cost operations through memory cache
PHP usually plays an important role in retrieval and data analysis. These operations may cause performance degradation. In fact, some operations are completely unnecessary, especially the repeated retrieval of some common static data from the database. Consider using memcached extension to cache data in the short term. The extended memcached cache works with the libmemcached library to cache data in Ram. It also allows users to define the cache duration and helps ensure real-time updates of user information.
Http://www.phpbuilder.com/columns/php-performance-tips/Jason_Gilmore07122011.php3? Page = 1