8000 file not found ApcClassLoader.php in bootstrap.php.cache in hosting server · Issue #20655 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

file not found ApcClassLoader.php in bootstrap.php.cache in hosting server #20655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adityarai opened this issue Nov 27, 2016 · 11 comments
Closed

Comments

@adityarai
Copy link
adityarai commented Nov 27, 2016

[27-Nov-2016 19:29:05 Asia/Kolkata] PHP Warning: require(/home/nadiarafl/public_html/var..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php): failed to open stream: No such file or directory in /home/nadiarafl/public_html/var/bootstrap.php.cache on line 1780
[27-Nov-2016 19:29:05 Asia/Kolkata] PHP Warning: require(/home/nadiarafl/public_html/var..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php): failed to open stream: No such file or directory in /home/nadiarafl/public_html/var/bootstrap.php.cache on line 1780
[27-Nov-2016 19:29:05 Asia/Kolkata] PHP Fatal error: require(): Failed opening required '/home/nadiarafl/public_html/var..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/nadiarafl/public_html/var/bootstrap.php.cache on line 1780

the above error log is generated by server...
I updated my symfony to 3.1.7. If i remove this line 1780 in bootstrap.php.cache, it works fine in prod hosting server:
namespace {require DIR.'\..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php';}

@xabbuh
Copy link
Member
xabbuh commented Nov 28, 2016

It looks strange that your path contains backslashes while your filesystem seems to be UNIX-based. Did you warm up the cache on a Windows system?

@adityarai
Copy link
Author
adityarai commented Nov 28, 2016

I'm using windows in my local system and its working fine there. But in hosting server (LINUX) it shows error. And yes, I did warmup the cache.

@xabbuh
Copy link
Member
xabbuh commented Nov 28, 2016

Where did you warm up the cache? On your local system or on the server?

@adityarai
Copy link
Author
adityarai commented Nov 28, 2016

In my local system actually,. i have no option to warm up cache in my shared hosting..

@xabbuh
Copy link
Member
xabbuh commented Nov 28, 2016

Does it work if you just remove the cache and let Symfony spin it up on the first request?

@adityarai
Copy link
Author
adityarai commented Nov 28, 2016

you mean the cache folder inside var? ,... Even if i remove cache folder it does not work,...

@xabbuh
Copy link
Member
xabbuh commented Nov 28, 2016

@nicolas-grekas It looks like we are using DIRECTORY_SEPARATOR somewhere when storing class file paths in the bootstrap cache. Do you remember if that was done on purpose and we didn't normalise them using / intentionally?

@nicolas-grekas
Copy link
Member

@adityarai can you please try #20676?

@adityarai
Copy link
Author

Yes, Its working fine now,... thank you,..

fabpot added a commit that referenced this issue Nov 29, 2016
…map (nicolas-grekas)

This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20676).

Discussion
----------

[ClassLoader] Use only forward slashes in generated class map

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20655
| License       | MIT
| Doc PR        | -

Commits
-------

6d1f1b5 [ClassLoader] Use only forward slashes in generated class map
@fabpot fabpot closed this as completed Nov 29, 2016
@athos99
Copy link
athos99 commented Dec 2, 2016

J'ai le même probleme, je travail sous Windows et génère tou mon projet pour produire un livrable, mais le livrable est prévu pour tourner sous linux et j'ai un problèeme depuis la version 3.1.7
Le fichier bootstrap.php.cache qui est généré sous windows contient à la dernière ligne.

namespace {require DIR.'\..\vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ApcClassLoader.php';}

Les \ ne sont pas comprix par linux

L'erreur provient du fichier \vendor\symfony\symfony\src\Symfony\Component\ClassLoader\ClassCollectionLoader.php
ligne 122 à 135.
On utilise DIRECTORY_SEPARTOR il faudrait soit utiliser '/' qui marche pour les deux environements ou alors utiliser la constante DIRECTORY_SEPARTOR et non sa valeur.
ce qui donerrait
namespace {require DIR.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'symfony'.DIRECTORY_SEPARATOR.'symfony'.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'Symfony'.DIRECTORY_SEPARATOR.'Component'.DIRECTORY_SEPARATOR.'ClassLoader'.DIRECTORY_SEPARATOR.'ApcClassLoader.php';}

Bon en attendant un patch ou une correction il suffit de rempalcer les \ par un /

namespace {require DIR.'/../vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ApcClassLoader.php';}

@xabbuh
Copy link
Member
xabbuh commented Dec 2, 2016

Please use English to describe your problem so that everybody is able to understand your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0