composer: autoload_real.php cannot include anything after composer update

Hi!

I’ve an terrible annoying problem that I can’t get solve, I hope someone can help me or confirm if there is an error in the composer update process.

Sometimes after a composer update the application (symfony2) completely hangs with some error similar to:

[Wed Mar 06 12:12:24 2013] [error] [client 127.0.0.1] PHP Warning: require(/var/www/some-project/vendor/kriswallsmith/assetic/src/functions.php): failed to open stream: Permission denied in /var/www/some-project/vendor/composer/autoload_real.php on line 41 [Wed Mar 06 12:12:24 2013] [error] [client 127.0.0.1] PHP Fatal error: require(): Failed opening required ‘/var/www/some-project/vendor/kriswallsmith/assetic/src/functions.php’ (include_path=‘.:/usr/share/pear:/usr/share/php’) in /var/www/some-project/vendor/composer/autoload_real.php on line 41

But is not a assetic bundle problem, If the line that loads the assetic line is removed or swaped with the next line, the error points to the next library to be loaded, and all the bundles are in their folders in the correct path.

Sometimes I got fix the problem by deleting the composer cache in “/root/.composer” and “/home/-user-/.composer”, removing all vendors and reupdating, sometimes I try download an old version of composer. But this only works sometimes and finally I get solve the problem without actually understand what solved the problem. Yesterday I removed all my project from the local machine and had to do a git checkout of a working version, and worked…

Is not a permissions problem because I tried change the all files and folders permissions to 777 and the owner to apache:apache and nothing happens, the error is still there. I also checked SELinux logs and disabled it but nothing.

Also I tried to have some different concurrent copies of the project in different paths/virtualhosts and some of them worked after a composer update and some of them didn’t

When the error doesn’t appear, the application works perfectly.

I have CentOS 6.4 with php 5.3.3 and apache 2.2.15 that are the officialy supported by CentOS. My development machine has the same environment than the production machine

PHP

PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Apache

Server version: Apache/2.2.15 (Unix)

I don’t find anything more in the logs and I think there is a problem with the composer update in some environments.

Any idea what is happening? maybe a workaround?

Thanks Tomás

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 29 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Delete the vendor folder and run composer update once again. Things will be alright.

I delete “/vendor” at .gitignore before upload to git and my project works whitout problems when download

Hey all,

I am having this problem too. I am using Fedora 18. Oddly, if I use PHP5.4’s bundled server, the site runs fine but if I use httpd, I get the below error:

Warning: require(/var/www/Recruiter/web/vendor/swiftmailer/swiftmailer/lib/swift_required.php): failed to open stream: Permission denied in /var/www/Recruiter/web/vendor/composer/autoload_real.php on line 41

Fatal error: require(): Failed opening required ‘/var/www/Recruiter/web/vendor/swiftmailer/swiftmailer/lib/swift_required.php’ (include_path=‘.:/usr/share/pear:/usr/share/php’) in /var/www/Recruiter/web/vendor/composer/autoload_real.php on line 41

None of the above suggestions seem to work for me.

I’m no sysadmin so I’m not much use on the file permissions side but I just thought I would log my findings in case it helps you guys out!

I’m also having the same problem while deploying my application on 000webhost, it shows that,

Warning: require(/storage/ssd1/418/20073418/mysite/vendor/composer/…/symfony/polyfill-mbstring/bootstrap.php): Failed to open stream: No such file or directory in /storage/ssd1/418/20073418/mysite/vendor/composer/autoload_real.php on line 41

Can you guys help me out? I’m getting so frustrated about this issue!