Can't install laravel installer via composer
It says that it requires zip extension
laravel/installer v1.4.0 requires ext-zip...
Install using (to install the default version):
sudo apt install php-zip
Or, if you're running a specific version of PHP:
# For php v7.0
sudo apt-get install php7.0-zip
# For php v7.1
sudo apt-get install php7.1-zip
# For php v7.2
sudo apt-get install php7.2-zip
# For php v7.3
sudo apt-get install php7.3-zip
# For php v7.4
sudo apt-get install php7.4-zip
Solution - Error during composer global require laravel/installer
The culprit in my problem is the laravel/homestead:v2.0
which requires lower version of everything else which conflicts with the higher version the laravel/installer
requires.
I edited my composer.json
, removed everything except the codesniffer
and required the latest laravel/installer version and it should install smoothly. The whole process did not install the laravel/homestead
automatically so I also manually required it and it ended up looking like this:
{
"require": {
"squizlabs/php_codesniffer": "^3.6",
"symfony/console": "v6.0.3",
"laravel/installer": "4.2.10",
"laravel/homestead": "^13.2"
}
}
Your laravel/installer should now work fine. And the laravel new project-name
command should working as intended.
PS: Your composer.json
location would be shown in the terminal but just in case, the default path would be:
C:/Users/{Your user name}/AppData/Roaming/Composer
Related Topics
Check If PHP-Page Is Accessed from an iOS Device
How to Run Cronjobs More Often Than Once Per Minute
Php.Ini Is Nonexistent Loaded Configuration File (None)
How to Get Output of Proc_Open()
How to Zip Folder Without Full Path
MySQL Code Causes PHP Script to Crash at Popen/Exec
PHP Passing C Struct Data Throught Socket Programming
How to Get Beanstalkd Queue to Work for PHP
Send PHP Date to JavaScript Date Format
How to Convert JSON to Xml in PHP
Int((0.1+0.7)*10) = 7 in Several Languages. How to Prevent This