Creating a web project using Xampp and Composer.
Whenever I try to run the Composer command:
C:\> composer create-project laravel/laravel <project name>
It gives me a diagnostic message saying that zip extension and unzip/7s commands are missing. The command does create a project but then it doesn't connect with SQL in XAMPP.
Due to the zip extension and unzip/7s commands missing it doesn't install required packages to make the project run.
I have tried uninstalling and reinstalling Composer but the error persists.
I am using php 8.2
Referring to the comments above, the problem was in the php.ini file. The zip extension was disabled, you need to enable the zip extension in php.ini.
Related
Installed composer in Synology DS916 and running Laravel 7.
when I use composer require Laravel/ui and composer require Laravel/passport to add package, composer have a message say not able to use ZIP command, download from source instead.
From phpinfo() and php -m, it looks zip package is enabled and running.
Does anybody can share some experience how to trace the problem ?
admin#ASCS:/volume1/web$ composer create-project --prefer-dist laravel/laravel new_project
Creating a "laravel/laravel" project at "./new_project"
Installing laravel/laravel (v8.0.3)
Failed to download laravel/laravel from dist: The zip extension and unzip command are both missing, skipping.
Your command-line PHP is using multiple ini files. Run `php --ini` to show them.
Now trying to download from source
- Installing laravel/laravel (v8.0.3): Cloning a6ca577839
---- omitted -----
admin#ASCS:/volume1/web$ php --ini
Configuration File (php.ini) Path: /usr/local/etc/php74/cli
Loaded Configuration File: /usr/local/etc/php74/cli/php.ini
Scan for additional .ini files in: /usr/local/etc/php74/cli/conf.d
Additional .ini files parsed: /usr/local/etc/php74/cli/conf.d/extension.ini,
/usr/local/etc/php74/cli/conf.d/timezone.ini
I try : which unzip => no result
I finally installed unzip to the Synology NAS by first install Easy Bootstrap installer, then use ipkg command install the unzip package.
I found out by reading on another forum that because zip had been removed from the official plugin set replaced by zlib, Synology had not included it with its distribution. They’ve since said they would include it in a coming update packade, but it has yet to happen. I’ve downgraded to 7.3 where zip is still avaialable, hoping that either Synology hold to their promise and include zip plugin or that framework developers start making their code using zlib alongside zip. Else the only way will be to get it will be to compile it from source or someone start distributing it in a community repo.
I am new to VS code. I am trying to work with PHP, but I keep getting this notification.
phpcs: Request workspace/configuration failed with message:unable to
locate phpcs. please add phpcs to your global path or use composer
dependency manager to install it in your project locally.
Intellisense doesn't work for PHP too.
I am using a Windows system. I tried to download and install Composer, but I am still getting the problem as shown in the screenshot.
]1
I have some extensions installed which are visible in the screenshot, but the issue persists.
The easiest way is to use composer to install phpcs globally and symlink the binary into your path;
Assuming you have composer installed and are using osx or linux (if not, follow instructions from here: composer) then install phpcs globally: open your terminal and type:
composer global require "squizlabs/php_codesniffer=*"
You will then need to make sure phpcs is in your path. The easiest way is to symlink into /usr/local/bin. open your terminal and type:
sudo ln -s ~/.composer/vendor/bin/phpcs /usr/local/bin/phpcs
I've downloaded a Symfony application and then checked it using php -f ./app/check.php. However, I get:
[ERROR]
Your system is not ready to run Symfony projects
Fix the following mandatory requirements
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Vendor libraries must be installed
> Vendor libraries are missing. Install composer following
> instructions from http://getcomposer.org/. Then run "php
> composer.phar install" to install them.
However, there is no composer.phar file in this application. e.g.
php composer.phar install
Could not open input file: composer.phar
Note: I already have composer installed.
Any suggestions?
The answer is right there in the error message you received.
Install composer following instructions from http://getcomposer.org/
Instead of composer.phar run:
php composer install
I think that's what you need. If you install Composer, then you probably renamed it to composer, and that's the bin you run.
I have executed the following command on windows command prompt
folder path >php composer.phar install
Getting Error
Could not open input file: composer.phar
Your command is trying to use composer which is not installed. It is not used to install composer. You have to install it using one of methods stated here:
https://getcomposer.org/doc/00-intro.md
The other option is that your path to composer file is wrong, which can also be fixed by following documentation.
I install laravel by running:
laravel new testing
And it responds with:
Application ready! Build something amazing.
Yet when I visit public/index.php, it presents an empty page that says:
Mcrypt PHP extension required.
When I run php -m it does not list Mcrypt.
I tried installing it with composer, by running:
composer create-project laravel/laravel laravel_composer --prefer-dist
And it resulted with the following:
Writing lock file
Generating autoload files
Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output:
There is nothing additional after "Error Output:"
Solution by OP.
I resolved the issue by updating to php55 and php55-mcrypt using homebrew.
I had an issue with conflicting php versions post-install, which I resolved by editing the apache2 httpd.conf property LoadModule php5_module. By uncommenting it and changing the default file path to look for local/php5-5.5.11-20140408-141340/libphp5.so.
Mcrypt was no longer an issue and apache was locating the correct php. The last thing I had to do was change the permissions of laravel_project/app/storage using chmod -R o+w storage