I have successfully installed Composer in the root directory (that was the default choice) on my Linux/Apache server using their installation guide. It's all been very simple so far, except for one php.ini tweak I've had to make (detect_unicode = Off
) but now I'm stuck.
I'm trying to install Ratchet using Composer, with the use of this guide:
http://socketo.me/docs/install
It says I need to "create a file called composer.json in your project folder". So I created that file (with the contents they gave on their page) using the cPanel file manager, in my application's root directory. However, when I run Composer using:
php composer.phar install
PuTTy gives the following error message:
Composer could not find a composer.json file in /root
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
But this doesn't seem to make sense, why would I place the JSON file in the server's root if the documentation says to place it in the project folder? What am I missing?
composer. json is a JSON file placed in the root folder of PHP project.
To install Composer in your project, you need an important file called “composer. json”. This file is where you define all the dependencies/packages needed in your project. So quickly create a project folder, open it in any editor of your choice and create this file “composer.
Double-check you don't have typos in your composer. json or repository branches and tag names. Be sure to set the right minimum-stability. To get started or be sure this is no issue, set minimum-stability to "dev".
Updating and Uninstalling Composer From there, you can verify Composer's installation by running --version command from the terminal. If the command returns the version code, it means the Composer is installed, and you are ready for the next steps.
I just found on other topic that you can use :
php composer.phar --working-dir=/home/user/folder/ update
It looks like you're executing php composer.phar install in /root path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With