php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80862 "Class not found" using Opcache & Xenforo
Submitted: 2021-03-14 11:55 UTC Modified: 2021-03-17 21:42 UTC
From: alex at ndros dot com Assigned: cmb (profile)
Status: Not a bug Package: opcache
PHP Version: 7.4.16 OS: Windows Server 2019
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: alex at ndros dot com
New email:
PHP Version: OS:

 

 [2021-03-14 11:55 UTC] alex at ndros dot com
Description:
------------
Hi,

We're using PHP 7.4.16 NTS with Opcache. 
We randomly get "class not found" errors with the software that we run (Xenforo 2.2).

For example:

Class 'XF\Mvc\Entity\Repository' not found

This is solved after an IIS reset, but after a few minutes, we may get the same on another class not found error.

Our Opcache config is:

[OPCACHE]
zend_extension = "php_opcache.dll"
opcache.memory_consumption=256
opcache.cache_id=node1
opcache.error_log="D:\temp\php\opcache.log"
opcache.validate_timestamps=1
opcache.revalidate_freq=30
opcache.interned_strings_buffer=32
opcache.save_comments=0
opcache.max_file_size=0
opcache.file_update_protection=2
;opcache.file_cache_consistency_checks=0 // not used
;opcache.file_cache="D:\temp\php\opcache_filecache" // not used
opcache.max_accelerated_files=10000
opcache.log_verbosity_level=4
opcache.blacklist_filename= "D:\inetpub\wwwroot\******.com\conf\opcache\opcache-blacklist.txt"
opcache.enable_cli=1
opcache.max_wasted_percentage=10

Thank you
Alex

Test script:
---------------
We haven't found a specific way to reproduce the issue.

Expected result:
----------------
We haven't found a specific way to reproduce the issue.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-14 11:57 UTC] alex at ndros dot com
-Operating System: Windows 2019 +Operating System: Windows Server 2019
 [2021-03-14 11:57 UTC] alex at ndros dot com
Typo: we may get the same OR another class not found error.
 [2021-03-15 09:17 UTC] cmb@php.net
Does this happen after you modified some of the PHP files?

Are there other PHP processes running for the same user with the
same cache_id?

Are there any relevant warnings in the OPcache error log?
 [2021-03-15 09:17 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-03-15 14:01 UTC] alex at ndros dot com
-Status: Feedback +Status: Assigned
 [2021-03-15 14:01 UTC] alex at ndros dot com
Hi,

No, there's no modification on the files. This appears to happen randomly.

---Are there other PHP processes running for the same user with the
same cache_id?

I'm not sure about that. We do use 2 worker processes for the IIS application pool. We did try to use just 1, but the error happens with this configuration as well.

----Are there any relevant warnings in the OPcache error log?

No, the OPcache error log only contains entries like:

Message Cached script
Message Added key
Debug Loading blacklist file:
 [2021-03-15 14:50 UTC] cmb@php.net
> We do use 2 worker processes for the IIS application pool. We
> did try to use just 1, but the error happens with this
> configuration as well.

Nonetheless, please try

    opcache.cache_id=${APP_POOL_ID}

and use separate application pools for different applications.
 [2021-03-15 14:50 UTC] cmb@php.net
-Status: Assigned +Status: Feedback
 [2021-03-15 19:38 UTC] alex at ndros dot com
ah nice, I didn't know I could use an environment var in php.ini
we've done:

opcache.cache_id=${APP_POOL_ID}

and also running different application pool for each app (joomla, xenforo).

I will report if this solves our problem.

Thanks !
 [2021-03-17 20:00 UTC] alex at ndros dot com
-Status: Feedback +Status: Assigned
 [2021-03-17 20:00 UTC] alex at ndros dot com
Hi,

It seems that the new configuration has solved our issue.

Thank you
 [2021-03-17 21:42 UTC] cmb@php.net
-Status: Assigned +Status: Not a bug
 [2021-03-17 21:42 UTC] cmb@php.net
> It seems that the new configuration has solved our issue.

Happy to hear that!  Thanks for the confirmation.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC