简体   繁体   中英

Laravel is not working on Ubuntu 16.04 VPS

I have been trying all day to get Laravel up on a Virtual Server that is being served by 1&1 Hosting. The thing is, I am terrible at Command Line tasks but wanted to take on the challenge for educational purposes.

What I did was transfer my entire folder where laravel lived on my localhost (where it worked perfectly) into my virtual server. After doing that, when I goto http://myip/myproject ...all I get is:

This page isn’t working

myip is currently unable to handle this request.
HTTP ERROR 500 

However, before I was getting a 404 error so I know something happened. I am not exactly sure why this is happening and for some reason I am unable to access the error log. One thing I can provide however is that I tried to run php artisan dump-autoload and got the following error:

[Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "dump-autoload" is not defined.

I can also access folders like the app folder without problem which would not have been possible on my localhost

Here is a quick list to successfully install laravel!

  • [ ] Point you document root to your public folder
  • [ ] Install composer on server
  • [ ] sudo apt-get install php7.0-mbstring
  • [ ] sudo apt-get install php7.0-zip
  • [ ] sudo apt-get install php-xml
  • [ ] sudo apt-get install php-curl
  • [ ] a2enmod rewrite (Enable apache mod rewrite, if using apache)
  • [ ] Give writting permissions on Storage and Bootstrap folder
  • [ ] run composer install on your project folder
  • [ ] run your migrations and change the .env to connect to database
  • [ ] service apache2 restart

And remember that the command is composer dump-autoload.

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