简体   繁体   中英

Laravel on shared hosting issue

I'm a fairly new laravel developer, I am developing my website in laravel 5.5 and I've been trying to get my website online for a few days now. it kept giving me error message like:

Warning: require_once(/dirpath/htdocs/vendor/composer/autoload_static.php): failed to open stream: No such file or directory in /dirpath/htdocs/vendor/composer/autoload_real.php on line 28

Fatal error: require_once(): Failed opening required '/dirpath/htdocs/vendor/composer/autoload_static.php' (include_path='.:/usr/share/pear/') in /dirpath/htdocs/vendor/composer/autoload_real.php on line 28

since it is a free shared hosting server without SSH (I cant run laravel command there), I did make sure to do everything from paying attention to folder structure (placing the content of public outside) and every project files/folders in the htdocs content (I know it can be insecure, I just wanted to show the client the progress of the website for a few days before I took it down). I also did composer install, composer update, composer dump-autoload, various artisan command to clear the cache before I push it to the server, but as you can see, the error persist.

a bit of inspecting on my end, and I keep seeing the autoload_static that autoload_real has been trying to require, kept disappearing along with the autoload classmap. What is the reason that is causing this and what should I do to make the error go away?

Thanks in advance, I tried all I know and did some research but I just stuck, hope you guys can help with this.

also: I can't really get myself a vps or a paid hosting right now.

Update 25/04/2018 : I did composer update --no-dev and re-upload the whole thing again to the vendor, but it is still the same error, anybody has a suggestion? I really am stuck at this point.

In this situation you can't do anything on the server without SSH . In your local copy run composer update --no-dev . Then delete server's vendor folder & copy your local's vendor folder to the server.

load psr-4 instead: inside autoload_real.php, please find the code like shown below:

$classMap = require DIR . '/autoload_psr4.php';

At least this is a dirty trick to make it work. Once you have the money, then may be moved to a well-equipped server later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM