# Laravel 12 installation on InfinityFree free hosting

**URL:** <https://forum.infinityfree.com/t/laravel-12-installation-on-infinityfree-free-hosting/121775>\
**Category:** Hosting Support\
**Created:** [November 3, 2026, 3:09am UTC](https://forum.infinityfree.com/t/laravel-12-installation-on-infinityfree-free-hosting/121775 "2026-11-03T03:09:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesar\_elearning](https://forum.infinityfree.com/letter_avatar/cesar_elearning/32/6_449c533f586939b6e5f246632a46421f.png) [@cesar\_elearning](https://forum.infinityfree.com/u/cesar_elearning)\
**Post date:** [November 3, 2026, 3:09am UTC](https://forum.infinityfree.com/t/laravel-12-installation-on-infinityfree-free-hosting/121775/1 "2026-11-03T03:09:44Z")

</div>

### Website URL

[https://e-learning-ia.site.je](https://e-learning-ia.site.je)

### Error Message

No error yet. I have not deployed Laravel because I need to confirm the recommended secure installation structure for InfinityFree free hosting.

### Other Information

Hello,

I want to deploy my Laravel 12 E-Learning application on InfinityFree free hosting.

My hosting account has PHP 8.4.27, the required PHP extensions, and an imported MySQL database.

My application uses Composer, Vite, DomPDF, and an external Python FastAPI service.

The file manager shows an `htdocs` directory and a warning not to upload files outside it.

I would like to know:

1. Can I store the Laravel application files (`app`, `bootstrap`, `config`, `vendor`, `storage`, and `.env`) securely outside `htdocs`?
2. If this is not possible, what is the recommended secure installation structure for Laravel?
3. Can I use `.htaccess` to redirect requests to Laravel’s `public` directory and protect internal files?
4. Does InfinityFree allow outgoing HTTPS requests to an external Python FastAPI service?

I have prepared the production dependencies locally but have not uploaded the application or any credentials.

Thank you for your help.

---

<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:** [November 3, 2026, 3:09am UTC](https://forum.infinityfree.com/t/laravel-12-installation-on-infinityfree-free-hosting/121775/2 "2026-11-03T03:09:44Z")

</div>

Welcome to the InfinityFree community forum! Good to have you here.

- Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
- Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
- AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
- Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

---

<div class="post-metadata">

**Author:** ![Lemni](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lemni/32/68303_2.png) [@Lemni](https://forum.infinityfree.com/u/Lemni)\
**Post date:** [November 3, 2026, 3:10am UTC](https://forum.infinityfree.com/t/laravel-12-installation-on-infinityfree-free-hosting/121775/3 "2026-11-03T03:10:07Z")

</div>

_Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look._

**1 and 2.** I found an article that covers this. The web root on InfinityFree is always `htdocs`, and it can’t be changed. So the usual Laravel layout, with the app files outside the web root, isn’t the setup here. The recommended structure is to upload the whole Laravel project into `htdocs`, including `vendor`, `storage` and `.env`. Your local prep (`composer install --no-dev`, `npm run build`, no `node_modules`) matches what the article says to do.

Full guide:

> [@How to install a Laravel site on InfinityFree](https://forum.infinityfree.com/docs?topic=118578):
>
> Laravel is one of the most popular PHP frameworks, but it was not designed with regular shared web hosting in mind. Some parts of Laravel work out of the box on InfinityFree, some need a bit of configuration, and some features cannot be used at all. This article walks you through what to do, what to watch out for, and what you’ll need to work around. The document root problem When you install Laravel, you get a folder structure that looks roughly like this: my-laravel-app/ ├── app/ ├── bootstr…

**3.** Yes, and that’s how the article keeps it secure. You create a `.htaccess` in `htdocs`, next to Laravel’s own `public/.htaccess`, with this:

```auto
RewriteEngine On
RewriteRule (.*) /public/$1 [L]

```

Every request is then rewritten into `public`. A request for `/.env` or `/storage/logs/laravel.log` becomes `/public/.env` or `/public/storage/logs/laravel.log`. Those files don’t exist, so visitors get a 404. If you use the public disk for uploads, the article adds a `storage/` rewrite rule before the catch-all, because symlinks aren’t supported. It also lists `.env` settings: `APP_DEBUG=false`, file sessions and cache, and `QUEUE_CONNECTION=sync`. It says scheduled tasks and queue workers can’t run on free hosting either.

**4.** Yes, with limits. Outbound requests from your site work through cURL, `file_get_contents()` and similar, so Laravel’s HTTP client is fine. But only ports 80, 443 and 587 are open, and they can’t be opened on request. Your FastAPI service therefore has to answer HTTPS on port 443, not on something like 8000 or 8080. Connections to blocked ports time out instead of being refused. The article also lists a few services that are blocked entirely, such as Discord, Telegram, Cloudflare Workers and Google Apps Script, so don’t host the FastAPI service on one of those. Outbound IPs aren’t fixed, so you can’t allowlist your site’s IP on the FastAPI side.

Details on ports and blocked services:

> [@Can I connect to other servers from my website? (Sockets, cURL and APIs)](https://forum.infinityfree.com/docs?topic=49348):
>
> Your website can connect to other servers, for example to call an API, load data from another website or send email through an external SMTP server. This works with functions like cURL, file\_get\_contents() and fsockopen(). However, to prevent abuse, outbound connections are limited to a small set of ports and services. Which ports can I use? Port Used for 80 HTTP 443 HTTPS 587 SMTP (sending email) All other ports are blocked. This means you cannot connect to things like: APIs …

---

<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 3, 2026, 11:41am UTC](https://forum.infinityfree.com/t/laravel-12-installation-on-infinityfree-free-hosting/121775/4 "2026-11-03T11:41:03Z")

</div>

The article still works, but it is not possible to place files outside of the htdocs folder, _but only if the domain has it’s own folder, not if it’s linked to the main htdocs folder_. If you have a free subdomain now, you can remove it and then add it again to have it assigned to a domain specific folder.

Besides that, everything that Lemni said applies.

---

<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:** [November 10, 2026, 11:41am UTC](https://forum.infinityfree.com/t/laravel-12-installation-on-infinityfree-free-hosting/121775/5 "2026-11-10T11:41:14Z")

</div>

Closed on November 10, 2026, 11:41am UTC

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