|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-09-08 13:58 UTC] nicolas dot grekas+php at gmail dot com
Description: ------------ This is a follow up from https://bugs.php.net/78175 Using https://github.com/nicolas-grekas/symfony/releases/download/php-bugs/preload-failures-78175.tar.bz2 I run php -S localhost:8000 -t public/ -dopcache.preload=var/cache/prod/srcApp_KernelProdContainer.preload.php Then in another console: php info.php Today, this fails with Class'ComposerAutoloaderInit0fc59465a08737274a67ea5841756d9a' not found. When I call get_declared_classes(), the class is not listed. But when I call opcache_get_status(), I see the class listed in preload_statistics. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 13:00:01 2025 UTC |
I've been testing preload today on 7.4RC3 and also can't get it to work. I don't know if its the same bug as this or unrelated, I'm testing with 2 simple scripts: preload.php <?php class A{} test.php <?php require_once('preload.php'); class B extends A {} echo "ok"; when I run this without preload it works fine, when I enable preload opcache.preload=/sambafs/preload.php opcache.preload_user=apache (I'm using php-fpm) and try loading test.php I get Fatal error: Uncaught Error: Class 'A' not found in ... if I dump opcache stats I can see it there [preload_statistics] => Array ( [memory_consumption] => 3160 [classes] => Array ( [0] => A ) [scripts] => Array ( [0] => /sambafs/preload.php ) ) but its not under get_declared_classesVerified, with a trivial reporoducer Normal user $ echo '<?php class Foo {}' > Foo.php $ php -d opcache.preload=Foo.php -r 'var_dump(class_exists("Foo"));' bool(true) Root user # php -d opcache.preload_user=remi -d opcache.preload=Foo.php -r 'var_dump(class_exists("Foo"));' bool(false)