1

我在 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 吗?

请帮忙!

4

1 回答 1

0

你犯的错误是做一个./configure--enable-opcache当然应该有的默认值,但你还需要指定一个--with-php-config=.../php-configwhere...表示 5.4 php-config 的路径。

于 2014-08-01T18:17:13.513 回答