index.php should be in the public folder.
Your document root should point to the public folder
There should also be a .htaccess file in public
Check these?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I know there have been endless questions about deploying laravel projects (trust me I've been reading them all for the last 48 hours). I have a laravel and vue.js app that I am trying to host. I started with trying to use cPanel even though a lot of people said shared hosting was bad. Got it to the point where the page was loading but a lot of components and css were missing. So I switched to digitalocean, uploading the project was fine, it was nice that it built it for me from my github repo. But the problem I'm getting is that when my project builds, there is no index.php which causes a 403 error.
Laravel 11 PHP 8.2.12 Vite Vue 3.5.6
And my vite.config because I feel like the problem might reside in here:
import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import laravel from "laravel-vite-plugin";
export default defineConfig({ plugins: [ laravel({ input: ["resources/js/app.js", "resources/css/app.css"], refresh: true, }), vue({ template: { transformAssetUrls: { base: null, includeAbsolute: false, }, }, }), ], resolve: { alias: { vue: "vue/dist/vue.esm-bundler.js", }, }, server: { port: 5173, hmr: { host: "localhost", }, }, build: { // Output to 'public/js' and 'public/css' directories rollupOptions: { output: { // Define where JS files will go entryFileNames: "js/[name].js", chunkFileNames: "js/[name].js", assetFileNames: ({ name }) => { if (name && name.endsWith(".css")) { // Define where CSS files will go return "css/[name].css"; } return "assets/[name][extname]"; }, }, }, outDir: "public", // Ensure output goes to the public directory emptyOutDir: true, // Clear previous builds }, });
Let me know if any more details are needed
Please or to participate in this conversation.