Public file needs/should be the only file accessible from the outside world.
In a perfect world you clone a git repository on your server and run composer install. Not ftp your project up.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone! I am new to laravel and i want to upload laravel 5 application to server using filezilla. what should i do? what should be the directory structure for deployment? Thanks in advance..
Public file needs/should be the only file accessible from the outside world.
In a perfect world you clone a git repository on your server and run composer install. Not ftp your project up.
But I uploaded L5 code to server from ftp and it works fine for index.php but navigating to other views shows internal server error. Also it works correctly on localhost. I think further navigation unable to find their related files.
@Farooq-99 Yes. Realize you are making an image copy. The sub-directory, i.e. the Laravel Project Has To Be Exact.
Given the directory structure you should autoload ok. What are specific errors?
@jimmck thanx for responding to this conversation. I simply put/upload laravel project on Remote Site in root directory (i.e "/" ) from ftp (filezilla). I doesn't change directory structure and made no changes to any file for deployment settings prior to upload the project.
-> Then I access the site as: domain.com/public/index.php, this view has a login form and a signup link.
-> When I click on signup link it makes url as: domain.com/public/MemberSignup (all pages are blade.php files, i.e MemberSignup.blade.php ) and shows a page with Error 404 : Not Found.
I am confused how to fix it and what changes should I make to index.php or .htaccess files.
you say you uploaded to / that will still be a folder on the web server. Your FTP client may be showing it as the root folder but actually its something more complicated, especially if its a shared host.
What you need to do is to find out if you can publish to one folder above this so that the laravel public folder equates to htdocs or wwwroot or whatever your hosting company decides is the web root folder
You are going to have continual issues and security problems whilst ever you have to put /public/ in your url. You can perform some magic with .htaccess to mitigate some of the problems but this is just a sticking plaster.
Oh, and I assume its a unix host and not Windows... you have not said.
You should use domain.com/
public is your root web folder and index.php controls your access.
Can you access domain.com/menu ?
Here is my .htaccess igonore/remove cache dir setting
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
#SetEnv AWS_PHP_CACHE_DIR /Users/jimm/GitHub/laravel5/storage/aws
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
</IfModule>
What @Snapey said and check your permissions. Root is not a good place but get the install working. You can move to image later.
Thanks @snapey for your response to this conversation, I am using windows host.
Here is the link to uploaded site: http://ogt.atomicity-interactive.com/public/index.php On index page, when I click on "Home" (below Laravel 5) it shows error page.
Also can't access ogt.atomicity-interactive.com/menu, it gives Error 404: NOT FOUND.
Can anyone please explain the steps to deploy laravel 5 app from scratch using FTP client. I am using 1&1 web hosting, phpstorm v8.1 for develpment, php v7.0.3, laravel framework version 5.2.36, xampp etc.. I'll be thankful for any help..
@jimmck I am unable to understand your points:
and my .htaccess is same as yours. I also confused that how the files in resources/views are accessed on server, because in development we uses signup.blade.php extension but on it only show signup , as we use in anchor tag as <a.. href="Account.signup"> Signup here </tag closed> any help or suggestion from anyone??
@jekinney thanks for responding to this conversation. Can you please explain the steps to deploy L5 app to server from git repository. I am still unable to uploading and executing code on server. Thanks in advance for any help..
Windows hosts do not support .htaccess
What are the steps or procedure to deploy L5 app to unix host??
Please or to participate in this conversation.