Composer installed in Synology DS916 NAS, unable to use ZIP command - php

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.

Related

Can not find zip extension and unzip/7s commands

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.

Cannot run composer self-update: "The phar signature did not match the file you downloaded"

The system is windows10 Enterprise
I installed composer; its version is 2.0.8
My symfony 4.4 does not launch with this version of composer; so I decided to downgrade composer with this command : composer self-update --1
But I get error :
The phar signature did not match the file you downloaded, this means your public keys are outdated or that the phar file is corrupt/has been modified
So how to fix this?
Try executing:
composer self-update --update-keys
to update your public keys, and rerun the self-update command.
If that doesn't work, your phar file is really corrupted, and you'll need to download again. Just grab the appropriate file from the "Manual download" section of the download page and overwrite your local composer copy.

how to run composer commands for laravel in mac os?

i am new to mac os.i have installed laravel in mamp server using manually not using composer.also installed composer but i dont know how to run commands like php artisan and all.
in windows i can easily point to composer like as i given answer to this question
Where and how can I run composer commands?
please help me how to in mamp server ?
thank you in advance
Updated::
Usage:
command [options] [arguments]
Options:
--help (-h) Display this help message
--quiet (-q) Do not output any message
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
--no-interaction (-n) Do not ask any interactive question
--profile Display timing and memory usage information
--working-dir (-d) If specified, use the given directory as working directory.
Available commands:
about Short information about Composer
archive Create an archive of this composer package
browse Opens the package's repository URL or homepage in your browser.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Set config options
create-project Create new project from a package into given directory.
depends Shows which packages depend on the given package
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader
dumpautoload Dumps the autoloader
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
info Show information about packages
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Show information about licenses of dependencies
list Lists commands
remove Removes a package from the require or require-dev
require Adds required packages to your composer.json and installs them
run-script Run the scripts defined in composer.json.
search Search for packages
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Show information about packages
status Show a list of locally modified packages
suggests Show package suggestions
update Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock
CPU664:~ narendrab$ php artisan
Could not open input file: artisan
CPU664:~ narendrab$
In mac os, you can easily install composer globally by
curl -sS https://getcomposer.org/installer | /Applications/MAMP/bin/php5/bin/php
mv composer.phar /usr/local/bin/composer
Then you can just use command composer everywhere without specifying full path. You have to use full path for MAMP php since php comes with mac will be default.
Edit: run artisan command within the project directory.

Google plus login functionality and composer library install

I am working on Google + login functionality for that purpose I am referring https://developers.google.com/+/quickstart/php url. I have done all the suggested instructions
Enabled google plus api
Set up the PHP quick-start app
In second step to run signin.php file they are suggesting to Install composer and run command php composer.phar install.
I have already installed Composer on my machine and it is up to date.
I am not getting how to run php composer.phar install command as the code cloned from https://github.com/googleplus/gplus-quickstart-php.git does not have composer.phar file (only have composer.json and composer.lock files)
How do I install these dependencies as when I run signin.php file
Fatal error appears as autoloader.php not found.
I am guessing that by using composer I need to download directory from https://github.com/google/google-api-php-client.git as this is written in composer.json file.
Let me know what should I do?

fuelphp Composer is not installed. Please run "php composer.phar update" in the root to install Composer

I am trying to install fuelphp.
And getting the error as
Composer is not installed. Please run "php composer.phar update" in the root to install Composer
In my xampp/php directory I run a command
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
But once i run php composer.phar install composer could not find a composer.json in e:\xampp\php
How can i resolve and run fuelphp successfully can anyone help.
As of 1.7.1, we no longer supply the composer.phar file in the zip. It only has a limited shelf life (30 days before it starts complaining).
Instead we suggest you install composer yourself, either locally (specific for this fuelphp installation) or globally so you only have to install it once for all your projects.
Composer is a tool for dependency management in PHP, like npm for Node.js, bundler for ruby, and others.
It reads a file called composer.json with the dependent libraries your project needs and, finally, installs (downloads) them for you.
Fuelphp can be installed using composer, but there are several packages.
So, you need to create the composer.json with all needed fuelphp packages. Open notepad, save a file with the name composer.json (be sure to save it with ".json" extension) and put this content:
{
"require": {
"fuelphp/upload": "2.0.1",
"fuelphp/event": "0.2.1",
(...)
}
}
Note you need to insert at "(...)" the others fuelphp packages and the needed versions. You can check them all at https://packagist.org/ (type fuelphp at search). Packagist is the main Composer repository.
More information about Composer at this link.
Let me know if you need more information about it.
If you are running FuelPHP 1.7, the download comes with all Composer files you need. You need to run php composer.phar install in the root directory of FuelPHP (the same directory that contains the public folder and the fuel folder.
As long as you have v1.7 (I'm not sure if earlier versions contain the files), that directory will contain composer.json and composer.phar.
In folder fuelphp-1.7 (latest), there are two files: composer.phar and composer.json you need to cd into that folder and run:
php composer.phar install
If you don't have php in your path, you should do something like:
e:\xampp\bin\php\php5.4.16\php.exe composer.phar install
Use the full path to your php.exe. Remember your current working directory should be fuelphp folder where composer.phar and composer.json are.

Categories