|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72199 opcache_compile_file() function throws error message.
Submitted: 2016-05-11 15:02 UTC Modified: 2016-05-11 15:47 UTC
From: ian at subnet192 dot com Assigned:
Status: Closed Package: opcache
PHP Version: 7.0.6 OS: Ubuntu 14.04 x86
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ian at subnet192 dot com
New email:
PHP Version: OS:


 [2016-05-11 15:02 UTC] ian at subnet192 dot com

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");

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

I'm calling this script in command line : php -c php.ini compile.php

Actual result:
Running var_dump(opcache_get_status()) returns :

  string(63) "/hunt_opcache"

Here we can see opcache_enabled is false.

Running var_dump(opcache_get_configuration()) returns the following relevant lines :

  array(28) {
  array(2) {
    string(9) "7.0.6-dev"
    string(12) "Zend OPcache"

... Here, OPcache configuration shows that OPcache is enabled.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [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
Ok, I figured out what the issue is.

Seems like enabling file_cache_only will disable the opcache_compile_file function.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 03:01:29 2024 UTC