I've been pulling my hair out over this one for a few days.
I have a Laravel web app that I'm trying to deploy to my webserver. I started making the app a few weeks ago and started with a fresh Laravel installation of the latest stable build.
When I first tried to install Laravel via composer it told me my PHP version was out of date. I needed 7.3 or higher and had 7.2 installed. I went ahead and followed this guide on installing php 7.4.
At first, I was getting a default 503 service unavailable error in Apache that I was able to pin down to a ProxyPass error on another domain virtual host. This was displayed in the Apache error logs when I checked them.
For now, I went ahead and simply disabled that site as it hasn't been in use for some time anyway.
Upon doing so I now get a styled "500 | Server error" screen which matches the Laravel default error code screens. However, the storage/logs/laravel.log
has no new errors when I go to check it. If I try to run artisan commands as php artisan migrate
the log does correctly write the output of these errors to the file. So it's not a permission error where the log cannot be written at all.
As it stands I've got the following installed on my webserver.
- Laravel 8.12
- PHP 7.4.13 (cli)
- Apache 2.4.29
So far what I've tried...
- The
.env
file is successfully created and has correct permissions. (it does) - Debugging is enabled (it is)
- As I've done with other Laravel installs on this server I made sure the file permissions are correctly set. (they are)
- I've checked my virtual host file (attached below) and it is a copy of one of my other Laravel sites virtual hosts with the relevant information changed. My other Laravel sites hosted on this server (2 other projects) are functioning normally.
- I made sure all of the php modules required by Laravel are installed and up to date. (they are as far as I can tell)
- Manually set debugging to
true
inconfig/app.php
and reloaded the config cache withphp artisan config:cache
Domains Virtual Host File:
<VirtualHost *:80>
ServerAdmin myemail@gmail.com
ServerName workworkwork.fitness
ServerAlias workworkwork.fitness
DocumentRoot /var/www/html/workout/public
<Directory /var/www/html/workout/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =workworkwork.fitness
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
If anyone has any ideas on how to debug this error the help would be greatly appreciated. As with deploying sites or setting up new domains I've run into issues before but usually Stack Overflow or other sites have easily Google-able resolutions. However, I haven't found one that works for me on this site yet. And without Apache or Laravel error reporting it's hard to know where to even begin.