0

I am trying to run laravel project in cPanel.

The problem is that composer runs outside the project root directory but not inside the project having composer.jsonfile.

Composer not working in project root

cPanel returns Killed when i try to run composer as in the image below:

Killed Issue

Edit:

Looking on the comments i have tried to run composer --help but still there is Killed issue.

composer --help command

I have upgraded the memory limit to 1024M from custom php.ini file as:

Upgraded memory limit from multiphp

but it is not yet changing in the terminal:

memory limit check from terminal

Could it be php configuration issues or some server issues?

Can anyone shed some light on this issue? I can update the question if it is not clear.

PaladiN
  • 4,625
  • 8
  • 41
  • 66
  • Maybe this will help you: https://stackoverflow.com/a/33082705/4171578. That is, maybe trying to run the command in the project root is not worth the effort, and you can run the command where it works, and just specify the working directory. – Amade Sep 23 '18 at 11:43

1 Answers1

0

It looks like your server runs out of memory when composer is executed thus the error message : Killed.

If you have access to more resources you might try to increase the ram and try again, otherwise you can just composer install on your local machine and upload the vendor folder to get you going for now until you sort the memory issue on your server.

Edit: from the screenshots I noticed that you didn't upload the composer.lock file, you might want to try uploading that file and simply run composer install as it's should require much less memory than composer update (since the dependencies won't be resolved on your live server but simply installed according to the hashes in your composer.lock file).

mrbm
  • 2,164
  • 12
  • 11
  • updated the post. and other thing is like i am not installing the dependency and just trying to run the `composer` command only. – PaladiN Sep 23 '18 at 09:30
  • not sure what do you mean by running `composer` command only ? it will try to install the dependencies per default, eg. if you run `composer --help` it will work fine and you will see the help message, not sure if increasing the memory from cPanel will affect the memory limit of the php when run in `CLI` mode as usually there is a different setting for that.. – mrbm Sep 23 '18 at 09:37
  • as per your comment i have tried to run `composer --help` but it is still showing `Killed`. I have also added the image for the command. – PaladiN Sep 23 '18 at 09:49
  • the OS is definitely killing the process as soon as it starts, no sure about your configuration but you will need probably to increase the swap/ram to sort this – mrbm Sep 23 '18 at 09:58