# Having trouble getting Laravel to work

**URL:** <https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643>\
**Category:** Hosting Support\
**Created:** [November 22, 2025, 4:27am UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643 "2025-11-22T04:27:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![garrettw87](https://forum.infinityfree.com/letter_avatar/garrettw87/32/5_5575768a8748004e209b776fc1b2916d.png) [@garrettw87](https://forum.infinityfree.com/u/garrettw87)\
**Post date:** [November 22, 2025, 4:27am UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/1 "2025-11-22T04:27:58Z")

</div>

I’ve followed the instructions [here](https://forum.infinityfree.com/t/deploy-laravel-5-to-htdocs/26038) to get Laravel to work, but I keep getting a 500 error from the web server (not from PHP, because turning display\_errors on doesn’t do anything). I even tried adding line 2 below to my .htaccess to prevent redirect loops, but it didn’t help. This is my root .htaccess right now:

```auto
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L]

```

And the one in `/public` hasn’t been modified from the stock Laravel version. My `.env` file is in place and the database has been created and all tables imported.  
Anyone have ideas of what I could try?

Edit: I tried renaming Laravel’s `/public/.htaccess` to disable it, and the error continues to happen. And when I rename the root one, I get a different error which I would expect. So it’s definitely coming from the root `/.htaccess` but I can’t figure out why.

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [November 22, 2025, 3:14pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/2 "2025-11-22T15:14:29Z")

</div>

What does the 500 error look like? Is it a generic NGINX error message, are you redirected to our 500 error page, or is it a Laravel branded error page? Knowing that would help determine what is generating the error.

Note that we also ask you to provide your website URL when asking for help. One of the reasons we do that is so that we can check the error ourselves, so we would have known without having to ask you.

> [@garrettw87](#):
>
> the web server (not from PHP, because turning display\_errors on doesn’t do anything)

Note that:

- The display\_errors option only works for PHP errors, not .htaccess error.
- The display\_errors option is not guaranteed to work. Website code can override the default PHP error handling functionality.

I know for a fact that Laravel has its own error handling system, so any error within a Laravel application will not be affected by the display\_errors functionality. The `APP_DEBUG` setting in your .env file is the way to enable error messages instead.

---

<div class="post-metadata">

**Author:** ![siglo\_ph](https://forum.infinityfree.com/letter_avatar/siglo_ph/32/5_5575768a8748004e209b776fc1b2916d.png) [@siglo\_ph](https://forum.infinityfree.com/u/siglo_ph)\
**Post date:** [November 22, 2025, 11:35pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/3 "2025-11-22T23:35:12Z")

</div>

> [@garrettw87](#):
>
> ```auto
> RewriteEngine On
> RewriteCond %{REQUEST_URI} !^/public/
> RewriteRule ^(.*)$ /public/$1 [L]
> 
> ```

Nice to hear from you again! Tried this and it’s working without error. Can you please provide a screenshot of what your successful Laravel app should look like from your local computer?

Be sure your app is working already locally so we can eliminate other potential problems. Your htaccess code is ok so I would assume the error is from something else.

Be sure to follow exactly what was said here and notify us if you accidentally missed or having trouble fulfilling a step:

> [@Deploy Laravel 5 to /htdocs](https://forum.infinityfree.com/t/deploy-laravel-5-to-htdocs/26038/2):
>
> you can run Laravel here, by **simply uploading all** the files of your Laravel codebase to the htdocs folder of your website … This **should include** the `vendor` folder created by Composer, since you cannot install the Composer dependencies by hand.
> 
> After that, you’ll need to **make any changes** necessary to your `.env` file, and **finally add** a .htaccess file as described here:

---

<div class="post-metadata">

**Author:** ![garrettw87](https://forum.infinityfree.com/letter_avatar/garrettw87/32/5_5575768a8748004e209b776fc1b2916d.png) [@garrettw87](https://forum.infinityfree.com/u/garrettw87)\
**Post date:** [November 22, 2025, 11:59pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/4 "2025-11-22T23:59:46Z")

</div>

Sorry, I should have mentioned what it looked like. The HTTP response body was empty, so it was just the browser’s error message. And I noticed a header from “openresty” — no Apache, Nginx, or PHP.

The URL is [http://pfdb.garrettw.net/](http://pfdb.garrettw.net/)

I’m not at home rn so I can’t provide a screenshot from local but I’ll do that later.

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [November 23, 2025, 9:32am UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/5 "2025-11-23T09:32:09Z")

</div>

I think the blank 500 error means that there is an .htaccess code issue. Normally you should get a more informative error page, but that doesn’t appear to be working.

A quick look at your .htaccess file also shows me that you’re currently using different code than what I shared in that article, and code that honestly doesn’t quite right to me. So I’m guessing that that’s the reason you get this error.

---

<div class="post-metadata">

**Author:** ![garrettw87](https://forum.infinityfree.com/letter_avatar/garrettw87/32/5_5575768a8748004e209b776fc1b2916d.png) [@garrettw87](https://forum.infinityfree.com/u/garrettw87)\
**Post date:** [November 23, 2025, 4:08pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/6 "2025-11-23T16:08:04Z")

</div>

Making it exactly the same as that article doesn’t change anything. I did try that.

---

<div class="post-metadata">

**Author:** ![siglo\_ph](https://forum.infinityfree.com/letter_avatar/siglo_ph/32/5_5575768a8748004e209b776fc1b2916d.png) [@siglo\_ph](https://forum.infinityfree.com/u/siglo_ph)\
**Post date:** [November 23, 2025, 11:53pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/7 "2025-11-23T23:53:40Z")

</div>

I tried this myself, the article was written about 6 years ago. And this is the result:

 ![screen-lara01](https://forum-cdn.infinityfree.net/original/3X/0/0/002d52e8e750dd2fcc54befa18701f460e27a5f9.png)

Laravel can run on IF with the limitations specified in the old thread, and the article works even for the uninitiated up to this date.

It seems you have a rich experience with Laravel already and this might be a little bit too obvious exercise for you. But we can walk it through slowly to identify the real problem. If you gained access to your local copy already, other than the screenshot of a working site (so we know what to expect and compare), kindly provide also the screenshot/list of files (including hidden ones) and folders of the local root directory only.

Since one might suspect the .htaccess file, we can temporarily disable it by renaming it to not\_good\_htaccess.txt or something like as stated here:

> [@Http error 500](https://forum.infinityfree.com/t/http-error-500/49352/1):
>
> you can remove or rename your .htaccess file (to `.htaccess.backup`, for example) and refresh the page. If you don’t see the HTTP ERROR 500 anymore, that likely means there was an error in the .htaccess file.

With root’s .htaccess disabled, your Laravel site should be temporarily accessible in [http://pfdb.garrettw.net/public](http://pfdb.garrettw.net/public) . This should output similar to your local copy or should throw a more informative error if Laravel was able to catch it.

---

<div class="post-metadata">

**Author:** ![garrettw87](https://forum.infinityfree.com/letter_avatar/garrettw87/32/5_5575768a8748004e209b776fc1b2916d.png) [@garrettw87](https://forum.infinityfree.com/u/garrettw87)\
**Post date:** [November 24, 2025, 6:42pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/8 "2025-11-24T18:42:37Z")

</div>

Thanks for your reply. After disabling the root .htaccess and accessing [http://pfdb.garrettw.net/public/](http://pfdb.garrettw.net/public/) I still get the same empty-body 500 error from openresty.

---

<div class="post-metadata">

**Author:** ![KangJL](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/kangjl/32/12130_2.png) [@KangJL](https://forum.infinityfree.com/u/KangJL)\
**Post date:** [November 25, 2025, 12:53am UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/9 "2025-11-25T00:53:14Z")

</div>

I see this

 ![image](https://forum-cdn.infinityfree.net/original/3X/2/5/25cb755df5e62b0bd46d245d3b33fc29a00059a1.png)

No openresty

---

<div class="post-metadata">

**Author:** ![siglo\_ph](https://forum.infinityfree.com/letter_avatar/siglo_ph/32/5_5575768a8748004e209b776fc1b2916d.png) [@siglo\_ph](https://forum.infinityfree.com/u/siglo_ph)\
**Post date:** [November 25, 2025, 3:07am UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/10 "2025-11-25T03:07:38Z")

</div>

Thank you for confirming. I tried recreating this and it appears we have the same error now.

 ![screen-lara02](https://forum-cdn.infinityfree.net/original/3X/4/c/4c58b305103e9093fc1e141efe48c2b15421d00e.png)

The very first installation as admin already described was truly really messy. Unfortunately, I haven’t documented every error I got and the exact steps I did to fix it other than following the prescribed steps above to the letter.

With assumptions of your local copy is running error-free, the root .htaccess in htdocs folder temporarily disabled, the vanilla Laravel .htaccess is in public folder, and performed the HTTP 500 troubleshooting tips in the previous article but still with the same result; I could think of a few things.

One, it is possible the Laravel copying was corrupt. You may need to reupload everything again, starting with the vendor folder only as this is of considerable size. If reuploading just the vendor folder still fails you may really need to reupload everything. I wish there is a simpler way but I’m unaware how to check the checksum of files in your local copy against the online copy. It is better to delete the online copy and upload a new copy than replacing or overwriting on top of the old one.

Is file corruption possible? Speaking based on experience, well yes, especially with large and lengthy uploads. My simple Laravel installation took hours and there were frequent disconnects and timeouts. Not sure, but it may be possible you had the same. You may need an FTP client like [FileZilla](https://filezilla-project.org/download.php?type=client) for a job like this. Tell us again if the error still persists or something new came up.

* * *

EDIT:

Two, you may try this before or after the first one. But it is better we are sure we are not dealing with corrupt uploads.

On your vanilla Laravel .htaccess inside public folder (the root .htaccess is currently disabled temporarily), add the following lines just below RewriteEngine On

```auto
 php_value display_errors On
 php_value mbstring.http_input auto
 php_value date.timezone America/New_York

```

Save and revisit your site. If Laravel is corrupt you should get a different error probably a Warning and/or Fatal error.

---

<div class="post-metadata">

**Author:** ![garrettw87](https://forum.infinityfree.com/letter_avatar/garrettw87/32/5_5575768a8748004e209b776fc1b2916d.png) [@garrettw87](https://forum.infinityfree.com/u/garrettw87)\
**Post date:** [November 25, 2025, 3:46pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/11 "2025-11-25T15:46:43Z")

</div>

I can’t help but wonder if there is a file permission issue somewhere that I have no ability to see or fix. Anyway, the php\_value changes didn’t do anything so I may just try a reupload, but I’ll do it as a zip file and extract it on the server.

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [November 29, 2025, 4:39pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/12 "2025-11-29T16:39:58Z")

</div>

I just tried to setup a new Laravel site using the .htaccess lines I wrote all those years ago, and I had no trouble setting up the website. I didn’t test anything beyond the default landing page, but at least it proves that the .htaccess code doesn’t break the server.

[https://laravel-demo.page.gd](https://laravel-demo.page.gd)

What may make debugging difficult is that _usually_ Laravel overrides the system error handler with it’s own functionality. But if that doesn’t work for any reason, there is really no way to find out what’s going wrong.

There is nothing that can be done on the server level to fix this, websites can and should be able to change how errors are handled, but all code can break.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [December 6, 2025, 4:40pm UTC](https://forum.infinityfree.com/t/having-trouble-getting-laravel-to-work/116643/13 "2025-12-06T16:40:50Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
