今天升級(jí)php遇到坑,記憶一下
linux php 5.6怎么開(kāi)啟opcache 這個(gè)問(wèn)題,一般百度到結(jié)果是說(shuō) php5.6 自帶opcache 可是就是沒(méi)有,然后看phpinfo也有 '--enable-opcache' 的編譯選項(xiàng),這就更對(duì)了,可是可是怎么就是沒(méi)有呢,讓后找自己的各種問(wèn)題。
最后看到官方,才知道,php5.6自帶opcache是謠言,不但沒(méi)有而且還不允許靜態(tài)編譯,只能用動(dòng)態(tài)鏈接庫(kù)的方式聯(lián)入,唉,坑啊。浪費(fèi)時(shí)間啊。話(huà)說(shuō)如果沒(méi)有 '--enable-opcache' 的編譯選項(xiàng)的你的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.
最后來(lái)電分享精神,為您節(jié)約時(shí)間
php5.6 opcache.so linux 編譯好的動(dòng)態(tài)鏈接庫(kù) 文件下載
http://pan.baidu.com/s/1nvltBPB