Home >Backend Development >PHP Tutorial >I got an error when installing composer on php7. Why is it reported that php5.dll is missing? Could it be that php7 does not support composer?
Make sure your php can be started normally using the command line.
It is not recommended to use GUI installation program, it is recommended to use command line installation.
Reference: Packagist / Composer China full image - how to install Composer
<code>php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php php composer-setup.php php -r "unlink('composer-setup.php');"</code>
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 system:
Find and enter the PHP installation directory (it should be the same set of PHP as the php command you executed on the command line).
Copy composer.phar to the PHP installation directory, which is the same directory as php.exe.
Create a new composer.bat file in the PHP installation directory and save the following code into this file.@php "%~dp0composer.phar" %*
Finally, reopen a command line window and try executing composer --version to see if the version number is correctly output.
I successfully installed PHP version 7.0.1 using this method today. However, I turned on the Shadowsocks global system agent during installation, so the installation went very smoothly.
Remember to add the directory of php.exe to the system PATH.