EAccelerator is an open source PHP Accelerator Used to optimize programs, encoders, and dynamic content caching. It caches PHP scripts during compilation to improve their performance, so the system overhead can be almost eliminated during compilation. It can also optimize scripts to accelerate their execution speed. Using eAccelerator can reduce the number of servers
EAccelerator is an open source PHP Accelerator Used to optimize programs, encoders, and dynamic content caching. It caches PHP scripts during compilation to improve their performance, so the system overhead can be almost eliminated during compilation. It can also optimize scripts to accelerate their execution speed. Using eAccelerator can reduce the number of servers
EAccelerator is an open source PHP Accelerator Used to optimize programs, encoders, and dynamic content caching. It caches PHP scripts during compilation to improve their performance, so the system overhead can be almost eliminated during compilation. It can also optimize scripts to accelerate their execution speed. Using eAccelerator can reduce server load and improve PHP code execution efficiency.
I. Preparations
1. Download the original php code and Binary Package
Address: http://windows.php.net/download/
2. Download The eaccelerator (select the zip package)
Address: http://eaccelerator.net/
3. php configuration file config. w32.h
Address: http://download.csdn.net/detail/cwqcwk1/5675195
Ps:
1. Download the Binary Package and configuration file to save the php compilation process.
2. Php is divided into vc9 and vc6 versions under win, which must be selected before download. The compiled extension can only be used for the corresponding php version.
3. If vc6 and vc11 are selected, modify the vc information in config. w32.h.
Ii. decompression process (vc9 is selected in this example)
1. Directly decompress php-5.3.26-src.zip,eaccelerator.zip to d :\
2. Copy config. w32.h to d: \ php-5.3.26-src \ main directory
3. Decompress php-5.3.26-win32-vc9-x86.zip and decompress it to the d: \ php Directory.
4. Copy d: \ php \ dev \ php5ts. lib to the eaccelerator folder.
5. Cut the eaccelerator folder to d: \ php-5.3.26-src \ ext
Iii. compilation process (the error may be related to the eaccelerator Version)
1. Open the eaccelerator project .. \ win32 \ eAccelerator. sln and set it to Win32 Release.
2. Configure project properties: Link Library-general, add "..." to the additional library directory;
3. Start to compile the project. The following error may occur:
.../Main \ streams/php_stream_transport.h (85): error C2143: syntax error: missing ') 'before '*'
.../Main \ streams/php_stream_transport.h (85): error C2081: 'len Len _ t': name in formal parameter list illegal
Solution: the macro error cannot be found. Open this file and add typedef int socklen_t;
4. Continue compilation. The following errors may occur:
\ Ext \ eaccelerator \ ea_store.c (205): error C2143: syntax error: missing '; 'before' type'
\ Ext \ eaccelerator \ ea_store.c (207): error C2065: 'pline': undeclared identifier
Solution: because the project does not use the standard C syntax, move "zend_op * opline, * end;" to "ADDSIZE (size, from-> last * sizeof (zend_op )); "above, that is, the header in the if structure.
5. Continue compilation. There should be no other errors. After completion, find eAccelerator_ts.dll in the Release directory.
Iv. Conclusion
1. This article not only describes how to compile eAccelerator in windows, but also describes how to directly compile php extensions in windows without using cygwin.
2. Php version control is not ideal and is difficult to avoid. There are great differences between 4.0, 5.0, and 5.3, and there are differences between compilers and thread security in the same version. Therefore, pay attention to this issue during development.