How to install composer in phpStudy in windows

Source: Internet
Author: User
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.pharFile, 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 BashIn this way, you can use Linux commands in CMD. Then runphp -i | grep opensslCheck whether any results are returned. If yes, it is enabled. If Not InstalledGit BashIt doesn't matter. CMD has its own commands.php -i | findstr opensslThanks for @ Deloz's friendly reminder.

If not, firstphp -i | grep php.iniCheck 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_dirJust go to the specific address.

Now let's run it again.php -i | grep opensslOrphp -i | findstr opensslCheck 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.CurlSo runcurlThe command has no pressure.curlDirectlyhttps://getcomposer.org/installerThere is no problem accessing this address to copy and save it. For example, the file name you saved iscomposer_install.phpThen you need to runphp composer_install.php --version=1.0.0-alpha8 --filename=composer.

It is best to specify--versionThis 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.jsonRun in current pathphp composer_dir installAll right.composer_dirThe 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.