The PHP official release PHP5.4 has been a while, according to the use of the situation, it seems to be very good. Fixed a number of bugs from the initial release to the current upgrade to PHP5.4.4. PHP5.4 new version, in addition to provide more new features, there is a significant increase in efficiency. After this version stabilized, I decided to upgrade my server to PHP5.4.4.
The software packages on the server have always been compiled and installed, so they are more manageable for these things. Download the latest source code package from the official PHP website, unzip and install it, nothing special. Here are the installation compilation parameters I used:
./configure --prefix=/usr/local/php-5.4.4/ --with-config-file-path=/usr/local/php-5.4.4/etc --with-mysql --with-mysqli --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pdo-mysql
make ZEND_EXTRA_LIBS=‘-liconv‘
make install
In the installation of Eaccelerator, there has been a wonderful error:
/home/package/eaccelerator-0.9.6.1/eaccelerator.c: In function ‘eaccelerator_restore’:
/home/package/eaccelerator-0.9.6.1/eaccelerator.c:878: warning: assignment discards qualifiers from pointer target type
/home/package/eaccelerator-0.9.6.1/eaccelerator.c: In function ‘eaccelerator_compile_file’:
/home/package/eaccelerator-0.9.6.1/eaccelerator.c:1317: error: ‘zend_class_entry’ has no member named ‘line_start’
/home/package/eaccelerator-0.9.6.1/eaccelerator.c: At top level:
/home/package/eaccelerator-0.9.6.1/eaccelerator.c:1913: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘eaccelerator_functions’
/home/package/eaccelerator-0.9.6.1/eaccelerator.c:1938: error: ‘eaccelerator_functions’ undeclared here (not in a function)
make: *** [eaccelerator.lo] Error 1
Reading the wrong case, Eaccelerator seems incompatible with the new version of PHP. Then two other accelerators, APC and XCache, were tried.
When installing APC, there is a tangled problem, the start php-fpm will be reported PHP-FPM segmentation fault error, and then search the Internet after the discovery of the solution, then selected XCache. See the official website recently released version 2.0, has fully supported the PHP5.4, so download back to compile installation, everything is normal!
I've seen an article about the performance comparisons of three accelerators (portals: "About PHP accelerated Eaccelerator, APC and Zend Optimizer"), and found that the differences between the three were smaller, and Eaccelerator won by a narrow margin. It seems that the choice of XCache is also a good choice.
Accelerator Eaccelerator not compatible with high version PHP