Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

towhid's avatar

how to transfer local server to live server site ?

please guide me step by step or suggest any reference link accurate .....

0 likes
23 replies
bobbybouwmann's avatar

Just copy everything... You provide zero information here!!

Normally you would use GIT. When using GIT you can simply clone or pull the same project on another server and you're good to go!

pardeepkumar's avatar

Normally you would use source control (i.e. GIT). But if you are really just looking to test it once you can FTP the files over. You don't need to move the vendor directory.

Connect through ssh and deploy using Git. I wouldn't recommend shared hosting for Laravel projects. It is better to go with a cloud infrastructure. If you don't know how to setup your own server on cloud, then you can do it using Cloudways Laravel hosting platform that gives you managed Laravel servers in one click.

Cronix's avatar

please guide me step by step or suggest any reference link accurate

That would depend entirely on your setup, and the server you're moving it to. Is it your own server? Shared hosting? Do you have ssh access? You don't give any info to adequately give you an answer.

jlrdw's avatar

please guide me step by step or suggest any reference link accurate

Do you realize how many times this has been answered with details right here on this forum. I myself have uploaded screenshots of proper folder setup and everything.

towhid's avatar

@Cronix hello , sorry to share lesss information, i have shared hosting , no i have no ssh acess ..

@jlrdw hello may yes i have many guide but not any thing clear me , could you please share your guided link which one you share with everyone in larcasts ..

@bobbybouwmann , i haveno idea how to use git and how to pull or push environment do you share me any reference guide link...

towhid's avatar

yes i solve my problem -

some time need change PHP version as like LARAVEL version need , and other's thing need to check the .htaccess file and index file.

towhid's avatar

nothing is serious for local to live server - if you want to check then you use xampp and before project start inex.php and htaccess file move public folder to project root folder. and then open your index.php file and edit this two line

require __DIR__ . '/vendor/autoload.php';
to 
require __DIR__ . '/../vendor/autoload.php';

and second one - is

$app = require_once __DIR__ . '/bootstrap/app.php'
to 
$app = require_once __DIR__ . '/../bootstrap/app.php';

thats it [ if your project run perfectly in local server - after file move( index.php & htaccess ) then must be run live server ]

and others thing you please make sure the live server configuration these list ar need to open --

PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension

and last thing - if you use storage link in your local server - then you must be command generate after successfully transfer your project live server -

thank you

1 like
Snapey's avatar

@towhid and then anyone can download /.env file

please don't advise other people to do this

1 like
towhid's avatar

@snapey sorry if i did any wrong here , i don't understand , could you please point me which thing is wrong . then i will delete my comment .

thank you

towhid's avatar

its show my .env file !! why this show what i will do for hide this file ? i never - see this problem - even my last project in live server but .env is not work its show this error -!!

Sorry, the page you are looking for could not be found.

please tell more about this thing. thank you @Cronix and @Snapey

Cronix's avatar

Because of the way you set it up, .env is in your document root, and document root is publicly accessible by the internet.

It should be something like (I don't know your host or their dir structure)

/home/your-account/.env
/home/your-account/app
/home/your-account/bootstrap
/home/your-account/config
/home/your-account/ ...{other laravel dirs/files)

/home/your-account/public_html
/home/your-account/public_html/index.php
/home/your-account/public_html/.htaccess

all laravel files/dirs should be outside of public_html (or whatever your document root is)

1 like
jlrdw's avatar

what i will do for hide this file ?

Please tell me you are kidding. With a link to exactly what to do and how to do it you asked again. Totally amazing.

towhid's avatar

@jlrdw yes i understand need to move others - Folder - without - public_html thank you

towhid's avatar

yes i understand the whole process and the structure now -

if i move all public folder files move root folder and others files and folder move another folder in root folder -- is it right process or need to change any folder directory ?

thank you

Snapey's avatar

The process is that the folder you serve to users is the public folder EVERYTHING else needs to be above that in the file system.

You can also rename public if your provider only serves public_html

If you find yourself moving .htaccess or renaming server.php to index.php then you are doing it wrong

towhid's avatar

@SNAPEY - @snapey please give me accurate solve process, i am confused lots of process reference , please finally give me one solution which one i am following , if you can please give me screen shot . thank you

towhid's avatar

@snapey And @cronix Sorry for post was not close , because of i was wrong thing local to live project transfer system ,

but my question is @cronix said this post

/home/your-account/.env
/home/your-account/app
/home/your-account/bootstrap
/home/your-account/config
/home/your-account/ ...{other laravel dirs/files)

/home/your-account/public_html
/home/your-account/public_html/index.php
/home/your-account/public_html/.htaccess
```
and @snapey  said
```
http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/
```
two solution is same ?  i have no live server hosting now in this moment where can i check , i am using - 000web host there  have some problem  . so need to know the answer from both of you then its really easy for me . thank you

Please or to participate in this conversation.