Question

I'm in need of using composer.php in my website (https://getcomposer.org/) but i am struggling to install and don't know where to begin even from looking at the getting started docs. I am using Mac OSX and code in php.

It says to install locally:

$ curl -sS https://getcomposer.org/installer | php

or

$ php -r "readfile('https://getcomposer.org/installer');" | php

or globally:

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

Where about do I put these commands? I have tried to put them in a php file (syntax errors) and then try to run in terminal but get command not found.

Sorry but i am extremely new to this kind of coding/installing to have very limited knowledge

Was it helpful?

Solution

All of the above commands are supposed to be executed on the command line (Shell or sometimes called Terminal). You have to have curl and php installed. You can also use wget or a browser to download the installer script. The installer script is a simple PHP CLI script.

OTHER TIPS

Since moest servers don't run on Mac Os X (and they shouldn't) it is best to have a 'development' machine you connect to.

If you don't have a spare server lying around (most of us don't) the best solution is to use a VirtualMachine that runs on your computer. E.g. Oracle Virtualbox

A nice tutorial can be found here: http://otaqui.com/blog/1652/setting-up-a-virtualbox-virtual-machine-for-web-development-with-multiple-sites-using-mod_vhost_alias-and-virtualdocumentroot/

You then have all your app software (e.g. php, curl, ...) on your development virtual machine (personally i use debian, but ubuntu, windows server,.. all do the trick).

You fire up the mac os x terminal, ssh into your server and then execute the composer commands. This way, if you app crashes, only the virtual machine crashes and it doesn't affect your local machine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top