109

I'd like to know if I can install or use the Laravel PHP framework on any web server without using Composer (PHP package/dependency manager) every time?

I would like to be able to drop my app on to any web server (like a shared server without access to the command line).

If I run composer install the first time (locally), then all the dependencies should be present, correct?

Then, I should be able to drop it onto any server with all of the files (including the vendor directory)?

ryanwinchester
  • 11,737
  • 5
  • 27
  • 45
  • 3
    for the record, meta discussion regarding this question is here: [Why is a question about setting up a php framework using a php package manager off-topic for programming?](http://meta.stackexchange.com/q/176089/165773) – gnat Apr 11 '13 at 08:01

7 Answers7

72

If you really wanted to, you could do all the work that Composer does manually, but you definitely should not. Installing Composer is easy, it's just a matter of getting the composer.phar file and running commands on it.

You do not need to run Composer on your server as well as locally, once you run composer install or composer update your project will have all its dependencies available and you can just upload it straight to your server.

ciruvan
  • 5,143
  • 1
  • 26
  • 32
Dwight
  • 12,120
  • 6
  • 51
  • 64
  • 3
    It's not an issue of difficulty or anything, I have installed it on my local webserver using composer. However, I'm still learning PHP and frameworks and developing a CMS based on Laravel for practice, but I would like to be able to drop it onto any webserver without having to use composer every time. Am I approaching this from the wrong angle? – ryanwinchester Apr 11 '13 at 03:55
  • 6
    Not at all. You can run Composer on the server as well if you like, but you can just as easily upload your local project wherever you want after running any Composer installs/updates locally. – Dwight Apr 11 '13 at 04:23
  • 2
    @Dwight: Does this also apply to servers without shell access? Unfortunately, many of my clients are on shared hosting that does not provide it, and I did not think that it would work. Can updates be performed using commands from a PHP script? – Mike Rockétt Apr 11 '13 at 05:47
  • 3
    Not as far as I'm aware, I suppose you could try `exec()` in PHP to run Composer updates but it would be just as easy to run those updates locally and then push the updated `composer.lock` and `vendor` directory to the server. – Dwight Apr 11 '13 at 06:21
  • 11
    I would go with Dwights suggestion of using composer locally (on the development server), and then pushing the whole working directory to the remote server. – Marko Aleksić Apr 11 '13 at 06:41
  • 1
    Excellent point about running composer locally and then uploading as this is a common problem with shared web hosting. – Marty Nov 18 '16 at 01:55
  • I have this problem where I can't use Composer in my company. All connections done with the command line are rejected. – Not The Real Hemingway Mar 30 '17 at 19:37
11

You cannot install laravel local without composer in your project.

5

On this site you can download everything what you can download also with the composer build tool. But you do not need a composer installation. Of course laravel is also present there: https://php-download.com/package/laravel/laravel

Stefan
  • 51
  • 1
  • 1
5

If you have shared server and you are not able to install composer and run cmd to install a new package or update an existing package.

You can one thing by installing composer on your local machine and install(ex composer require package/name) or update(ex composer update package/name) all the packages, then upload your vendor directory on the server with your code. it will work for you same as in your local environment.

NOTE: I strongly recommend that you should use the Laravel with the composer, it is an important part of laravel and you can try to convince your client to provide a server that supports laravel. Please check the link below and you can find the server requirements. https://laravel.com/docs/5.5#installation

Prashant Barve
  • 4,105
  • 2
  • 33
  • 42
1

If you don't want to use composer on server then you will have to run composer install/update and download all the libraries locally and then manually upload all those files on the server i.e. Vendor Directory.

In-Case of shared hosting where you can't connect to server with shh there you might have to do that but it will take lot of time to upload all the files on server so I would recommend that you should composer and then download the libraries through composer install/update.

Akshay Khale
  • 8,151
  • 8
  • 50
  • 58
0

Yes, you can install all project dependencies via composer in your localhost first, and then transfer all the files via FTP to your actual website.

shasi kanth
  • 6,987
  • 24
  • 106
  • 158
-3

Just download the zip file from github and upload to your htdoc and voilà it will work for you

Lonare
  • 3,581
  • 1
  • 41
  • 45
  • 3
    life is not so easy ,this is not good solution it require some dependent vender folders and files and also require autoload.php file – sms247 Jan 03 '17 at 09:57