I have a php project that was running on xampp but i created an ec2 instance with linux and i access it with his private ip on putty because the web app is supposed to be accessible just via intranet. i used stp to move the whole project, everything works the same but the composer on some php files give me that error( i got it from apache log)
PHP Fatal error: Uncaught Error: Failed opening required '/var/www/html/host/public_html/vendor/composer/../ezyang/htmlpurifier/library/HTMLPurifier.composer.php' (include_path='.:/usr/share/php') in /var/www/html/host/public_html/vendor/composer/autoload_real.php:41nStack trace:n#0 /var/www/html/host/public_html/vendor/composer/autoload_real.php(45): {closure}()n#1 /var/www/html/host/public_html/vendor/autoload.php(25): ComposerAutoloaderInitc3b80a39a0d2307602d3e5706c8f19a8::getLoader()n#2 /var/www/html/host/public_html/accessdata.php(18): require('...')n#3 {main}n thrown in /var/www/html/host/public_html/vendor/composer/autoload_real.php on line 41, referer: http://host/page1.php
i use composer to use the phpoffice, the user should be able to upload some excel files then using php i upload them on a database
EDIT: when running composer install
i get this error
Failed to download myclabs/php-enum from dist: curl error 28 while downloading https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483: Connection timeout after 10001 ms
2
Answers
@mega. As you mentioned you have uploaded the
composer.phar
file on server, try creating autoload.php file again by runningcomposer dump-autoload
command from root folder of your application and check if its working.composer dump-autoload
command regenerate the autoload file again and for that you do not need to have internet connection.If you run into error like "Failed to open stream: Permission denied" try run this command with
sudo
.You have a serious misunderstanding that should be put out of the way right from the beginning:
So you have certainly a relationship problem in your Composer marriage.
Composer therapist Nico Haase already commented, "You don’t need to install Composer on any production system" and if you’re looking for a second opinion, I second that. I actually would say, if you’re installing Composer on a production system you’re asking for trouble, problems, broken hearts (and dependencies).
You write it your own:
So, build the vendor folder locally with Composer, then upload the whole application code (including the vendor directory). Done.
Yes, done.
Machine working again.
And they lived long and happily.
(It may require reading, as every couples therapy is with the work of each individual to find back together. This can be a daunting time, always remind the bright outlook and all the future you two will have together, exploring the wild corners of the intranets together.)