ChatGPT解决这个技术问题 Extra ChatGPT

Can I Install Laravel without using Composer?

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)?


c
ciruvan

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.


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?
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: 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?
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.
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.
F
Flávio H. Ferreira

You cannot install laravel local without composer in your project.


@BARISKURT Sure! Added as answer, and deleted my comment. Request you to delete your comment too.
Where is your answer dude? I couldn't see. I deleted mine, by the now.
P
Prashant Barve

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


S
Stefan

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


A
Akshay Khale

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.


s
shasi kanth

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.


F
Francisco Corrales Morales

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


life is not so easy ,this is not good solution it require some dependent vender folders and files and also require autoload.php file