希望这里有人对此有所了解。
简短的问题
我在命令行上使用 phpdoc 遇到错误,通过 pear 在 PHP 7.0.2 上安装。错误是:
#> phpdoc
PHP Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException:
You have to enable opcache.load_comments=1 or zend_optimizerplus.load_comments=1.
in /usr/local/php5-7.0.2-20160108-102134/lib/php/phpDocumentor/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:193
如何修复此错误?
细节
Opcache 已启用并且opcache.load_comments=1
位于我的 opcache.ini 文件中,分别使用以下命令进行验证:php -i | grep "Opcode"
和php -i | grep "opcache"
。在该 .ini 文件中,我可以通过通过该文件检查启用和禁用 opcache 来验证更改是否已加载。
话虽如此,如果我opcache.load_comments=1
的 .ini 文件中有,为什么我仍然会收到此错误?
谢谢!