Deploy Laravel project to hosting
Deploy Laravel project to hosting
I downloaded the repo and I am trying to deploy it on the host. I moved files on server. Root looks like this:
ROOT-
--lsapp
---app
---bootstrap
---config
---database
---resources
---routes
---storage
...
--public_html
---css
---fonts
---js
---vendor
---index.php
...
In my public_html/index.php I have:
require __DIR__.'/../lsapp/bootstrap/autoload.php';
$app = require_once __DIR__.'/../lsapp/bootstrap/app.php';
But I have an error:
Warning: require(/home/platne/serwer22093/lsapp/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/platne/serwer22093/lsapp/bootstrap/autoload.php on line 17
Fatal error: require(): Failed opening required '/home/platne/serwer22093/lsapp/bootstrap/../vendor/autoload.php' (include_path='.:/usr/local/php56-fpm/lib/php') in /home/platne/serwer22093/lsapp/bootstrap/autoload.php on line 17
I don't know how to fix it.
Maybe I should use composer update --no-scripts
in cmd, but I have an error: 'composer' is not recognized as an internal or external command
.
When I type composer install
I have Could not open input file: composer
composer update --no-scripts
'composer' is not recognized as an internal or external command
composer install
Could not open input file: composer
Could anyone help me deploy this project?
vendor
public_html
lsapp
is it necessery to install composer on the server ?
– Mac
Aug 31 at 18:28
If you want to use the composer command then yes, if you don't need to run it on the server, then no.
– Jon Stirling
Aug 31 at 18:31
to deploy project i have to use command composer update --no-scripts. I cant install composer
– Mac
Aug 31 at 18:36
Then you can always upload it with your project, it's only the one file and run that from your project dir or something. The main problem is your
vendor
folder's location though.– Jon Stirling
Aug 31 at 18:41
vendor
1 Answer
1
First you need to ssh into your hosting server and install composer, once completed you will be able to run composer commands.
If still can't find composer when trying to run it you may need to add it the PATH variable, also check that your PHP version(php -v) is compatible with your Laravel version server requirements.
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
For some reason you've put
vendor
inpublic_html
instead oflsapp
. As for the second bit, have you installed composer on the server?– Jon Stirling
Aug 31 at 18:18