For example, phpStudy makes it easier for me to switch the environment and some one-click functions are very useful. Now, for example, how can I install composer in the selection of nginx + php5.3? For example, phpStudy makes it easier for me to switch the environment and some one-click functions are useful. Now, for example, select
How to install composer?
Is it possible to solve the environment variable setting?
Reply content:
For example, phpStudy makes it easier for me to switch the environment and some one-click functions are useful. Now, for example, select
How to install composer?
Is it possible to solve the environment variable setting?
Well, I have installed the subject successfully. Here is my experience. In fact, the most difficult part of the installation process is to downloadcomposer.phar
File, it should be a network problem. You can use GFW to try the effect, but I don't have it here. Because of network problems, I gave up using exe to install the Super convenient method, so I operated it manually.
First, you need to set the PHP environment variable, but it does not matter if it is not set. Make sure that the command line can run PHP.
Check whether the openssl plug-in is installed.
The PHP command line configuration file and the common configuration file (corresponding to the Web site) are not a file control, so you may be php. openssl plug-in is added to the INI file, but it is very likely that the command line still prompts you Not to load it (this is also my mistake ).
We recommend that you installGit Bash
In this way, you can use Linux commands in CMD. Then runphp -i | grep openssl
Check whether any results are returned. If yes, it is enabled. If Not InstalledGit Bash
It doesn't matter. CMD has its own commands.php -i | findstr openssl
Thanks for @ Deloz's friendly reminder.
If not, firstphp -i | grep php.ini
Check where the configuration file is located (you can change itphp -i | findstr php.ini
), Which is displayed here?C:\Windows
. But it is depressing that I have not found php in this folder. INI file, and then I searched and found that we only need to put the common php. copy ini to this directory and modifyextension_dir
Just go to the specific address.
Now let's run it again.php -i | grep openssl
Orphp -i | findstr openssl
Check is generally found.
Run the following code to download the installation file:curl -sS https://getcomposer.org/installer | php -- --version=1.0.0-alpha8 --filename=composer
.
I have installed it separately.Curl
So runcurl
The command has no pressure.curl
Directlyhttps://getcomposer.org/installer
There is no problem accessing this address to copy and save it. For example, the file name you saved iscomposer_install.php
Then you need to runphp composer_install.php --version=1.0.0-alpha8 --filename=composer
.
It is best to specify--version
This parameter fails because I have not specified the download function ). Wait for a while (I am here), so that composer can be downloaded.
It is easy to run.composer.json
Run in current pathphp composer_dir install
All right.composer_dir
The corresponding amount is the address of your composer file.
I didn't use Composer when I used Windows, and now I don't need Windows. Although I haven't used phpStudy, Composer is a PHP-dependent command line tool, so it has nothing to do with nginx and others. It is only related to PHP and the system.
The official website has clearly written how to install Composer on Windows. For details, refer:
Https://getcomposer.org/doc/00-intro.md#installation-windows
Official Website + 1, there is also a more earthy method, applicable to the use of composer in cygwin, directly download composer. phar without configuring global variables:
You can copy composer. phar to the corresponding project directory and run it. For example, the root directory of each Symfony project is in parallel with composer. json. Then use the corresponding
{Path}/php composer. phar xxx
References
The reason is that you have not enabled the openssl extension of php. You can enable it in phpstudy and then install it.