|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-05-11 15:47 UTC] ian at subnet192 dot com
-Status: Open
+Status: Closed
[2016-05-11 15:47 UTC] ian at subnet192 dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
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.