Error during composer update/install upon migrating to remote server

1.2k views Asked by At

The error in question:

[RuntimeException] Error Output: PHP Warning: require(/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php): failed to open stream: N o such file or directory in /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload_real.php on line 58 PHP Stack trace: PHP 1. {main}() /home/admin/web/"webpage"/public_html/test/artisan:0 PHP 2. require() /home/admin/web/"webpage"/public_html/test/artisan:16 PHP 3. require() /home/admin/web/"webpage"/public_html/test/bootstrap/autoload.php:17 PHP 4. ComposerAutoloaderInit95cd02d44d232a8b8d6e5e52544d8647::getLoader() /home/admin/web/"webpage"/public_html/test/vendor /autoload.php:7 PHP 5. composerRequire95cd02d44d232a8b8d6e5e52544d8647() /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload _real.php:49 PHP Fatal error: require(): Failed opening required '/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php' (includ e_path='/home/admin/web/"webpage"/public_html/test/vendor/phpunit/php-text-template:/home/admin/web/"webpage"/pub lic_html/test/vendor/phpunit/php-timer:.:/usr/share/pear:/usr/share/php') in /home/admin/web/"webpage"/public_html/test/vendor /composer/autoload_real.php on line 58 PHP Stack trace: PHP 1. {main}() /home/admin/web/"webpage"/public_html/test/artisan:0 PHP 2. require() /home/admin/web/"webpage"/public_html/test/artisan:16 PHP 3. require() /home/admin/web/"webpage"/public_html/test/bootstrap/autoload.php:17 PHP 4. ComposerAutoloaderInit95cd02d44d232a8b8d6e5e52544d8647::getLoader() /home/admin/web/"webpage"/public_html/test/vendor /autoload.php:7 PHP 5. composerRequire95cd02d44d232a8b8d6e5e52544d8647() /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload _real.php:49

Background: Was developing locally, got to the point where I wanted to have a staging site. Set up the staging site on digital ocean (entOS 6.5 x64). I then cloned my git repo into my desired folder - configured vhosts DefaultDirectory to my public path.

A default installation works, composer update/install works. However, with my cloned repository I am getting said error. '/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php' is a file I made with some helper methods I could use in various controllers. It has not caused any problems locally. I can composer update/install locally, without any problems.

Any guidance would be greatly appreciated!

1

There are 1 answers

6
Alana Storm On BEST ANSWER

Are those literal quotation marks in your file path

/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php

Or are you just using that to indicate your website name normally goes there? If the former, I'd consider not doing that as it's pretty weird to have quotes in unix file names, and you may run into problems based on assumptions other people have made.

Regardless -- you have the information you need

[RuntimeException] Error Output: PHP Warning: require(/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php): failed to open stream: N o such file or directory in /home/admin/web/"webpage"/public_html/test/vendor/composer/autoload_real.php

PHP is telling you it tried to require in a specific file

/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php

but it could not find it ("failed to open stream"). This means either the file doesn't exist on the computer you're trying to load it from, or PHP can't see it for some reason (try dumping the results of is_readable('/home/admin/web/"webpage"/public_html/test/app/Http/helpers.php'); to see if PHP thinks it can read the file or not.