Zend OPcache需要Zend Engine API版本220090626

时间:2014-08-01 01:17:17

标签: debian plesk opcache

我在Debian Squeeze下更新了php 5.3到5.4。之后我尝试安装OPcache,这就是我所做的:

apt-get install build-essential php5-dev unzip
cd /usr/src
wget https://github.com/zend-dev/ZendOptimizerPlus/archive/master.zip
unzip master.zip
cd /usr/src/ZendOptimizerPlus-master
phpize
./configure
make
make test
make install

vi /etc/php5/conf.d/opcache.ini


;zend_extension=/usr/lib/php5/20100525/opcache.so ;PHP 5.4 can't use this, file not exist on my server
zend_extension=/usr/lib/php5/20090626/opcache.so ;PHP 5.3 got only this one (?)
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=8000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

/etc/init.d/apache2 restart

php -v
Zend OPcache requires Zend Engine API version 220090626.
The Zend Engine API version 220100525 which is installed, is newer.
Contact Zend Technologies at http://www.zend.com/ for a later version of Zend OPcache.

PHP 5.4.31-1~dotdeb.0 (cli) (built: Jul 25 2014 18:40:42)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.6.0, Copyright (c) 2002-2014, by ionCube Ltd.

我做错了什么? “phpize”给了我这个:

Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

不应该是:20100525,PHP 5.4?

帮忙吧!

1 个答案:

答案 0 :(得分:0)

您所犯的错误是默认./configure当然应该--enable-opcache,但您还需要指定--with-php-config=.../php-config,其中...表示5.4 php-config的路径。