11

I have a question about the way used to deploy a Laravel Application.

I have developed my application locally using Composer.

Now, I'm ready to deploy this application to the production.

I have (at the moment) a production server that use only FTP..

I have read this forum: Laravel Forum

but I think that this is not correct..

I have created a directory on my server for example: http://wwww.myserver.com/app

In the /app directory I copied (by FTP) all my files...

But this not work..I have to change something?

Safari
  • 11,437
  • 24
  • 91
  • 191
  • 1
    Is there an error message? You may need to go to http://wwww.myserver.com/app/public. Ideally, you should create the app folder outside of the publicly accessible folder, and then upload "public" to the accessible folder, often called "public_html" or "httpdocs". You may then have to edit the index.php file to point to the correct folder. – beech Feb 26 '14 at 14:20

3 Answers3

17

Let's say your doc. root folder is www

  1. Create a folder called laravel on your shared hosting (outside of www) and upload your application structure to this folder, except the public folder.
  2. Upload your public folder's content into the www folder
  3. Adjust the path structure in the bootstrap/paths.php file.
  4. Also change the paths in the www/index.php file to locate the new laravel folder.
  5. Done.

There are 2 more solutions (and my one in more detailed as well) in the following article as well:

http://driesvints.com/blog/laravel-4-on-a-shared-host

Sas Sam
  • 681
  • 4
  • 10
  • 25
0

Did you try http://wwww.myserver.com/app/public ?

If you didn't configure your bootstrap/paths.php and public/index.php, your site should open via http://wwww.myserver.com/app/public. But you also have to configure the database paths and credentials in app/config/database.php

In a normal setup, only the contents of your Laravel project's "public" folder should be placed in your "app" folder. All the other files are kept in a separate folder, in the root of your server.

This article shows how to configure the paths: http://myquickfix.co.uk/2013/08/hosting-laravel-4-on-cpanel-type-hosting-public_html/

Antonio Brandao
  • 218
  • 2
  • 10
0

I did the process for deploying my Laravel 4 app yesterday proposed by Sas Sam and did not need to install Composer--but I can see why people would do that, because with ftp, using Filezilla, I ran into the issue that out of over 3000 files, it missed--or rather copied "empty files" for four php files, including one of the major classes of the Illuminate class (RedirectRequests.php), causing the app to throw an error early on.

When I realized that file was empty, I spent several hours in Filezilla examining every file (there are a lot besides php files, but only php files that were empty were causing issues) in the Laravel folder I'd created, cross-referencing them with my local install, to paste code into a total of four "missing" php files, and it seems to be working fine now.

So perhaps doing a linux install of Composer directly on the server and then doing a fresh install of the same version of Laravel might have avoided that, I've been having issues with GoDaddy getting SSH access to my project so elected to just fine-tooth-comb my project, instead. As long as you have all the files up there, properly referenced through the bootstrap.paths and public index.php files, it should work.