protoc-gen-php icon indicating copy to clipboard operation
protoc-gen-php copied to clipboard

RuntimeException on PHP 5.5 with OPCache

Open ossinkine opened this issue 10 years ago • 2 comments

On first request the page is loaded successfully. But second time (page already in cache) fatal error is thrown:

RuntimeException: google\protobuf\FileOptions class does not find in .../vendor/protocolbuffers/protoc-gen-php/proto/autoload.php on line 55

Temporary solution: Add to OPCache blacklist (opcache.blacklist_filename) the following line:

**/vendor/protocolbuffers/protoc-gen-php/proto/autoload.php

ossinkine avatar Aug 06 '14 06:08 ossinkine

I'm getting the same results when autoload.php contains extension registry, i. e. it was generated from proto definition which has extensions. I believe it's due to C function zend_lookup_class() (used in file extension_registry.c in php-protocolbuffers) not performing autoload functions supplied by spl_autoload_register().

gsnoff avatar Oct 16 '14 16:10 gsnoff

I can confim Protagores' version fixes this issue.

webmaster777 avatar Mar 13 '15 14:03 webmaster777