SegmentFault (www. sf. gg) is a leading developer technology community in China. We hope to provide programmers with a pure and high-quality technology exchange platform to learn, communicate and grow with developers and create an era for developers!
Reply content:
Check whether your php can be started normally using the command line.
It is not recommended to use a GUI to install the program. we recommend that you use the command line to install the program.
Reference: Packagist/Composer full China image-how to install Composer
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.phpphp composer-setup.phpphp -r "unlink('composer-setup.php');"
Global Installation
Global installation is to install Composer to the PATH included in the system environment variable PATH, and then you can directly execute the composer command in the command line window.
Windows:
Find and enter the PHP installation directory (the same set of php commands as those executed in the command line ).
Copy composer. phar to the PHP installation directory, that is, the same level as php.exe.
Create a composer. bat file in the PHP installation directory and save the following code to this file.
@php "%~dp0composer.phar" %*
Finally, open a command line window and try to execute composer -- version to check whether the version number is correctly output.
Today, I successfully installed my account using this method. PHP version 7.0.1, but the global system proxy of Shadowsocks is enabled during installation, so the installation is quite smooth.
Add the php.exe directory to the system PATH.