Bug #72199 [Opn->Csd]: opcache_compile_file() function throws error message.
| From: | ian at subnet192 dot com | Date: | Wed, 11 May 2016 15:47:19 +0000 |
| Subject: | Bug #72199 [Opn->Csd]: opcache_compile_file() function throws error message. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201021@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72199&edit=1
ID: 72199
User updated by: ian at subnet192 dot com
Reported by: ian at subnet192 dot com
Summary: opcache_compile_file() function throws error
message.
-Status: Open
+Status: Closed
Type: Bug
Package: opcache
Operating System: Ubuntu 14.04 x86
PHP Version: 7.0.6
Block user comment: N
Private report: N
New Comment:
Ok, I figured out what the issue is.
Seems like enabling file_cache_only will disable the opcache_compile_file function.
Previous Comments:
------------------------------------------------------------------------
[2016-05-11 15:02:57] ian at subnet192 dot com
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 this bug report at https://bugs.php.net/bug.php?id=72199&edit=1