Laravel storage link won't work on production
There are several reasons why the Laravel storage link may not be working on production. Some common issues include:
The storage folder may not have the correct permissions. The storage folder and its contents should be writable by the web server.
The storage link may not have been created. In order to use the storage link, you must first create it using the command
php artisan storage:link
.The server may not have the correct PHP extensions enabled. Laravel requires the PHP extensions
fileinfo
andmbstring
to be enabled.The
config/filesystems.php
config file may not be configured correctly. Ensure that thedisks
array is configured correctly and points to the correct storage location.The server might be running with different user and group permission that the one used in your local environment. Make sure the user and group permission of the storage folder on the server match the one on your local environment.
It's important to check the logs for any error message and also ensure that the server you're running on is compatible with the version of Laravel you're using.