zendtech / ZendOptimizerPlus

Other
914 stars 142 forks source link

Failed to compile on PHP 5.6 #218

Open Quix0r opened 8 years ago

Quix0r commented 8 years ago

I have the following version on my server:

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

PHP 5.6.13-1~dotdeb+7.1 (cli) (built: Sep  4 2015 17:30:11) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

I was able to build it for 5.4 but with 5.6 it fails to build:

libtool: compile:  cc -I. -I/home/***/git/ZendOptimizerPlus -DPHP_ATOM_INC -I/home/***/git/ZendOptimizerPlus/include -I/home/***/git/ZendOptimizerPlus/main -I/home/***/git/ZendOptimizerPlus -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/***/git/ZendOptimizerPlus/ZendAccelerator.c  -fPIC -DPIC -o .libs/ZendAccelerator.o
/home/***/git/ZendOptimizerPlus/ZendAccelerator.c:39:35: fatal error: TSRM/tsrm_virtual_cwd.h: No such file or directory
compilation terminated.
make: *** [ZendAccelerator.lo] Error 1
dstogov commented 8 years ago

php 5.6 and above uses bundled ext/opcache.

On Sat, Sep 12, 2015 at 11:15 PM, Roland Haeder notifications@github.com wrote:

I have the following version on my server:

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

PHP 5.6.13-1~dotdeb+7.1 (cli) (built: Sep 4 2015 17:30:11) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

I was able to build it for 5.4 but with 5.6 it fails to build:

libtool: compile: cc -I. -I/home/_/git/ZendOptimizerPlus -DPHP_ATOM_INC -I/home//git/ZendOptimizerPlus/include -I/home/**/git/ZendOptimizerPlus/main -I/home/_/git/ZendOptimizerPlus -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home//git/ZendOptimizerPlus/ZendAccelerator.c -fPIC -DPIC -o .libs/ZendAccelerator.o /home/**/git/ZendOptimizerPlus/ZendAccelerator.c:39:35: fatal error: TSRM/tsrm_virtual_cwd.h: No such file or directory compilation terminated. make: *\ [ZendAccelerator.lo] Error 1

— Reply to this email directly or view it on GitHub https://github.com/zendtech/ZendOptimizerPlus/issues/218.

transat commented 3 years ago

I have this exact issue trying to install zendopcache in PHP 7.3.11 via pecl on my GridServer instance of my MediaTemple server. The Gridserver doesn't include a pre-compiled version of opcache.

rlerdorf commented 3 years ago

You need to build it from the PHP 7.3.11 tarball then.

Grab https://www.php.net/distributions/php-7.3.11.tar.gz

./configure && make

That will give you modules/opcache.so which you can copy to your extension directory and load normally in your ini