0

I have connected my cPanel access using PuTTY to install Composer to be able to run my Symfony application. On running composer install command on the server, I am getting this message as a throwback

composer could not find a composer.json file in /home/mydomain to initialize a project please create a composer.json file

I am kind of confused as I don't know where to create the composer.json on my server.

Please can someone assist am a newbie to this.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Francis
  • 201
  • 3
  • 7
  • 20
  • Did you already install Composer on your server or did you try to install Composer by running `composer install`. If it was 2nd then please read the Composer manual how to install Composer first. You might also find some good tutorials on google how to install and use Composer. – Pᴇʜ Feb 20 '17 at 09:14
  • I have browsed into the root of my project I uploaded I am doing composer self-update. I am getting permission denied – Francis Feb 20 '17 at 09:15
  • make sure the user which is running `composer self-update` has the rights to change files in the directory where you installed Composer. – Pᴇʜ Feb 20 '17 at 09:21
  • how do I edit the privilege. I logged in as admin – Francis Feb 20 '17 at 09:36
  • This depends on your OS. And I'm sorry that I have to say this, but these are basics an admin should know! If you don't know how to check permissions of a directory you should not be admin (at least if we are talking about a production environment). If this is for educational purpose only, I suggest to read some tutorials to learn the basics of your OS first. – Pᴇʜ Feb 20 '17 at 09:53

1 Answers1

0

Move to your project's root directory (Where the structure is App/, src/, Web/, composer.json).

Execute composer install from there.

If you're project is empty ATM just create a composer.json file where you want your project to be and put in it the content of the composer.json of your working local project

Mawcel
  • 1,967
  • 15
  • 22