Bug #72199 [NEW]: opcache_compile_file() function throws error message.

From: Date: Wed, 11 May 2016 15:02:59 +0000
Subject: Bug #72199 [NEW]: opcache_compile_file() function throws error message.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201019@lists.php.net to get a copy of this message
From: ian at subnet192 dot com Operating system: Ubuntu 14.04 x86 PHP version: 7.0.6 Package: opcache Bug Type: Bug Bug description:opcache_compile_file() function throws error message. Description: ------------ Hi! Compiling files through opcache_compile_file fails with the notice even if opcache is enabled: PHP Notice: Zend OPcache seems to be disabled, can't compile file in compile.php on line 8 The following lines of the zend_accelerator_module.c file seems to be the cause of the notice if I'm not mistaken. if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) { zend_error(E_NOTICE, ACCELERATOR_PRODUCT_NAME " seems to be disabled, can't compile file"); RETURN_FALSE; } Based on my configuration, ZCG(enabled) should return true. Therefore, my guess is that either accel_startup_ok or ZCSG(accelerator_enabled) is the issue here. Test script: --------------- // compile.php <?php var_dump(opcache_get_status()); var_dump(opcache_get_configuration()); opcache_compile_file("myfile.php"); ?> I'm calling this script in command line : php -c php.ini compile.php Actual result: -------------- Running var_dump(opcache_get_status()) returns : ["opcache_enabled"]=> bool(false) ["file_cache"]=> string(63) "/hunt_opcache" ["file_cache_only"]=> bool(true) Here we can see opcache_enabled is false. Running var_dump(opcache_get_configuration()) returns the following relevant lines : ["directives"]=> array(28) { ["opcache.enable"]=> bool(true) ["opcache.enable_cli"]=> bool(true) ["opcache.use_cwd"]=> bool(true) ... } ["version"]=> array(2) { ["version"]=> string(9) "7.0.6-dev" ["opcache_product_name"]=> string(12) "Zend OPcache" } } ... Here, OPcache configuration shows that OPcache is enabled. -- Edit bug report at https://bugs.php.net/bug.php?id=72199&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72199&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72199&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72199&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72199&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72199&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72199&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72199&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72199&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72199&r=support Expected behavior: https://bugs.php.net/fix.php?id=72199&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72199&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72199&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72199&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72199&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72199&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72199&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72199&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72199&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72199&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72199&r=mysqlcfg

« previous php.bugs (#201019) next »