今天升级php遇到坑,记忆一下
linux php 5.6怎么开启opcache 这个问题,一般百度到结果是说 php5.6 自带opcache 可是就是没有,然后看phpinfo也有 '--enable-opcache' 的编译选项,这就更对了,可是可是怎么就是没有呢,让后找自己的各种问题。
最后看到官方,才知道,php5.6自带opcache是谣言,不但没有而且还不允许静态编译,只能用动态链接库的方式联入,唉,坑啊。浪费时间啊。话说如果没有 '--enable-opcache' 的编译选项的你的php本身都得重新编译的。
PHP 5.5.0 and later
OPcache can only be compiled as a shared extension. If you have disabled the building of default extensions with --disable-all , you must compile PHP with the --enable-opcache option for OPcache to be available.
Once compiled, you can use the zend_extension configuration directive to load the OPcache extension into PHP. This can be done with zend_extension=/full/path/to/opcache.so on non-Windows platforms, and zend_extension=C:\path\to\php_opcache.dll on Windows.
最后来电分享精神,为您节约时间
php5.6 opcache.so linux 编译好的动态链接库 文件下载
http://pan.baidu.com/s/1nvltBPB