Laravel 5.4 --> forbidden 403 on files in Storage with 'public' visibility

Laravel 5.4 --> forbidden 403 on files in Storage with 'public' visibility

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Forbidden 403 Errors When Serving Public Storage in Laravel 5.4

Encountering a 403 Forbidden error when trying to display a file uploaded to your public disk is a classic issue in the Laravel ecosystem, particularly around version 5.4. The problem rarely stems from incorrect logic within your application code; instead, it usually points to a misconfiguration in your web server's access control or a broken filesystem link.

When you execute $request->file('logo')->store('logos/'.$account->id, 'public'), Laravel correctly places the file inside storage/app/public. The subsequent call to Storage::disk('public')->url($path) generates a URL that points directly to the web root, typically /storage/logos/.... If this path does not resolve to an HTTP response but triggers a 403 error, your web server (Apache or Nginx) is rejecting the request before PHP even processes it.

The most common cause for this behavior is a missing or broken symbolic link. In Laravel 5.4 and earlier versions, the storage/app/public directory is not automatically served by the web server. The application expects a connection between the web root's /storage path and the actual storage location. You must run the php artisan storage:link command to create this bridge. If you have recently updated your project, reset the server environment, or switched hosting providers, this link may have been severed. Running the artisan command again ensures that a symbolic link named storage exists in your public directory and points to app/public.

However, verifying the link exists using the ls -la command on the terminal is not enough; you must ensure the web server has permission to traverse it. On Linux-based systems, this often requires specific permissions. The standard practice is to set ownership of the entire storage folder tree to match your web server user (commonly www-data or apache) rather than leaving it as the default user who ran the PHP script (daemon, nobody, or your personal user account).

sudo chown -R www-data:www-data storage bootstrap/cache
sudo chmod -R 755 storage bootstrap/cache

If permissions are set to 755 but ownership remains with a non-web-user, the web server will receive a 403 error when attempting to read or serve files. Additionally, ensure that your .htaccess file in the root directory does not inadvertently block access to the /storage route. A common mistake is having a rule that denies access to specific folders or requiring authentication for every request within the storage path.

Another frequent pitfall involves URL rewriting. If you are using Apache without mod_rewrite enabled, or if your .htaccess file contains conflicting rules, direct access to files in the public directory can fail. The generated URL from Storage::disk('public')->url() assumes a standard web root configuration. If you have moved files manually outside of the Laravel storage structure or altered the APP_BASE_PATH, the generated URLs will point to incorrect locations.

Finally, consider the file extension and MIME types. While less likely to cause a 403, ensuring that your server can serve image files (like .jpeg or .jpg) is essential. If your web server configuration blocks certain extensions or requires specific headers, you might see errors during retrieval. Checking the web server error logs (error.log for Apache or access/error logs for Nginx) will provide specific clues if the link and permissions are correct but the issue persists.

For developers managing production environments with Laravel 5.4, always verify that the storage symlink is intact and that directory ownership aligns with your web server process. These steps resolve the vast majority of "file not found" or forbidden errors when serving user-uploaded assets like logos and avatars.

Our network