0

I have been trying to resolve this error for 2 weeks but have not resolve yet.

I have used all answers related to this issue but have not find any suitable solution for my problem :(

used commands

chmod -R o+w laravel_blog/storage
sudo chmod -R 755 laravel_blog
php artisan key:generate
php artisan cache:clear 
php artisan config:clear
sudo chown -R www-data:www-data ./storage

Please help me ||

5
  • A 500 error can be cause by hundreds of reasons which you have already figured out by the sounds of it :) Check the logs of your webserver and the laravel logs in storage/logs to figure out the error message which could help finding the solution and/or help us help you. Commented Jan 12, 2020 at 12:49
  • sir you can see logs and please help me in figure out the solution pastebin.com/ujvrPMxT Commented Jan 12, 2020 at 13:00
  • Please can you show a screenshot of the error screen. Commented Jan 12, 2020 at 13:05
  • ibb.co/QpkBbxT Commented Jan 12, 2020 at 13:15
  • I think you need to check the PHP error logs and the Laravel error logs to get to the bottom of this. I am not seeing the actual error here. Commented Jan 12, 2020 at 13:38

2 Answers 2

3
  1. Check in laravel root folder your .env file :

    a) Check if you have .env file , if not copy-paste .env.example to .env

    b) APP_DEBUG = true (when deploying to a server, after checking your app - change on false)

    c) APP_KEY = (these must be empty)

    d) Save .env file

    e) Run php artisan key:generate

    f) Open your website (all another errors server return)

  2. Run composer install

Sign up to request clarification or add additional context in comments.

1 Comment

b)APP_DEBUG = true (when deploying to server , after checking your app - change on false) helped me to see errors
0

This is my solution for apache2 on Ubuntu 20.4

I assume you already did the Steps from phwt & Taras. These are still necessary.

You need to change:

  • ServerName to your IP Address or Domain
  • DocumentRoot to the Path to your public Laravel directory
  • RewriteCond %{SERVER_NAME} = to your IP Address or Domain

File: /etc/apache2/sites-available/laravel.conf

<VirtualHost *:80>
   ServerName www.mylaravelproject.com
   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/laravel/public/

   <Directory /var/www/laravel/public/>
       AllowOverride All
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.mylaravelproject.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

After Saving this run:

sudo a2ensite laravel.conf
sudo systemctl restart apache2

(Optional, but recommended) If you want to use an SSL Cert do: sudo certbot and follow the instructions

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.