Error when installing Lumen framework with Composer - php

When I run
sudo composer global require "laravel/lumen-installer=~1.0"
I get an error (below) that says it failed to download elfet/php-ssh.
Changed current directory to /Users/chad/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing elfet/php-ssh (v1.1.0)
Downloading: Connecting... Failed to download elfet/php-ssh from dist: The "https://api.github.com/repos/elfet/php-ssh/zipball/439becf180272542cbf154df4856a49dd3c4bf04" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
I am meeting all the server requirements too. Any ideas why it's failing to install?

It is a elfet/php-ssh package not found issue and it was resolved
Refer: https://github.com/deployphp/deployer/issues/158
Or you can install lumen via composer create-project and refer the following link has good tutorial about install lumen and create a simple rest api.
link: http://wsnippets.com/create-rest-api-using-lumen-micro-framework-by-laravel/

Related

composer cannot download mail_mime package

I am trying to download mail_mime through composer but I got this error as illustrated below.
On window command line
C:\xampp\htdocs\google>composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package pear/mail_mime dev-master exists as pear/mail_mime[1
.10.0, 1.10.1, 1.10.2, 1.8.9, 1.9.0] but these are rejected by your
constraint.
Below is a capture of my composer.json file.
So what is wrong ?
In your composer.json try changining
"pear/mail_mime":"dev-master"
to a stable release for instance 1.10.2 as shown below.
"pear/mail_mime" : "1.10.2"
You should use a specific ( tagged stable at best ) version wherever possible.
Here's more information on how versioning and constraint works in composer.

Dependencies not installing correctly during Heroku deploy?

I'm trying to deploy a PHP app to Heroku but I don't think my dependencies are installing properly.
When I run git push heroku master I see these lines:
Installing dependencies...
Composer version 1.2.4 2016-12-06 22:00:51
Loading composer repositories with package information
Installing dependencies from lock file
-Installing components/jquery (3.1.1)
Downloading: 100%
-Installing fortawesome/font-awesome (v4.7.0)
Downloading: 100%
-Installing phpmailer/phpmailer (v5.2.22)
Downloading: 100%
No errors or anything. But when I open the heroku app after it's been deployed I have all kinds of console errors for jquery not being found.
I looked in developer tools in the sources tab and see a folder named vendor/fortawesome/font-awesome/css (that's the actual whole folder name) with the file font-awesome.min.css in it ... but shouldn't they all be installed in a vendor folder?
Not sure what I'm doing wrong.

Setting up php-casperjs with composer

I'm having trouble setting up php-casperjs for my project. I've never used composer before, so I'm not exactly sure what I'm doing wrong.
I got xampp installed on Windows with php version 5.6.12
Here are the steps I completed so far.
Downloaded and installed composer. It launches successfully from the command prompt.
Downloaded php-casperjs and extracted composer.json and src/Casper.php into my project folder C:\xampp\htdocs\test
Navigated to the project folder in the command prompt and ran composer install command which installed 22 packages
Then I ran composer require phpcasperjs/phpcasperjs command and here I ran into problems. I get the following error message
Using version ^1.2 for phpcasperjs/phpcasperjs
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package phpcasperjs/phpcasperjs No version set (parsed as 1.0.0) is satisfiable by phpcasperjs/phpcasperjs[No version
set (parsed as 1.0.0)] but these conflict with your requirements or
minimum-stability.
Installation failed, reverting ./composer.json to its original
content.
When I run the following php code
use Browser\Casper;
$casper = new Casper();
I get Fatal error: Class 'Browser\Casper' not found in C:\xampp\htdocs\test\test.php on line 3
Step1: Go to you project directory and create a file "composer.json"
codes for composer.json
{
"require": {
"monolog/monolog": "1.0.*"
}
}
Note: You can create you composer.json with your required packages but i just created a simple composer.json file with monolog/monolog package. For your understanding you can follow my steps (this). You can remove the package monolog later on.
Now navigate to the project directory where composer.json file located
Run the following command:
composer require phpcasperjs/phpcasperjs
And you faced the above problem because of wrong or mismatched version of the intended package. Keep in mind that you always can create composer.json with your custom packages and their versions and which will be your package manager. For more detail about composer please visit Link

Symfony install missing vendors libraries

I have a fresh install of Symfony with everthing looking in-place apart from my vendors directory is empty? That is, it has
composer and doctrine directories in it but they are empty. If I stand in my root and run the command:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Downloading: 100%
Failed to download doctrine/lexer from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing doctrine/lexer (v1.0.1)
Cloning 83893c552fd2045dd78aef794c31e694c37c0b8c
[RuntimeException]
Failed to clone git#github.com:doctrine/lexer.git via git, https, ssh protocols, aborting.
- git://github.com/doctrine/lexer.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer'...
fatal: remote composer already exists.
- https://github.com/doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
- git#github.com:doctrine/lexer.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/doctrine/lexer' already exists and is not an empty directory.
At the front end browsing to http://symfony.local/web/
Warning: require(C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php): failed to open stream: No such file or directory in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Fatal error: require(): Failed opening required 'C:\Apache24\htdocs\symfony.local\app/../vendor/autoload.php' (include_path='.;c:\php\includes') in C:\Apache24\htdocs\symfony.local\app\autoload.php on line 11
Clearly it's looking for /vendor/autoload.php but this isn't there. Why is my vendor directory empty and how can I ensure the libraries get installed?
$ composer update returns:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing paragonie/random_compat (1.1.4)
Downloading: 100%
Failed to download paragonie/random_compat from dist: Could not decompress the archive, enable the PHP zip extension.
The php.ini used by your command-line PHP is: /etc/php5/php.ini
Now trying to download from source
- Installing paragonie/random_compat (1.1.4)
Cloning d762ee5b099a29044603cd4649851e81aa66cb47
[RuntimeException]
Failed to clone git#github.com:paragonie/random_compat.git via git, https, ssh protocols, aborting.
- git://github.com/paragonie/random_compat.git
Cloning into '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat'...
fatal: remote composer already exists.
- https://github.com/paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
- git#github.com:paragonie/random_compat.git
fatal: destination path '/cygdrive/c/Apache24/htdocs/symfony.local/vendor/paragonie/random_compat' already exists and is not an empty directory.
Well, your PHP is not properly configured.
Adjust your /etc/php5/php.ini and enable the "ZIP" extension.
And the rest is probably a permissions issue, because you are using Cygwin in combination with Composer. Composer and Cygwin are not really best friends.
My suggestion: run Composer on the native Windows CLI, just for the vendor fetching part.
What you want is composer update. It will read your composer.json to install all required packages. composer install is used for deployment.
Download and enable the zip extention for PHP
If you are using PHP7.0 and use a debian base distribution (Ex: Ubuntu), use the following to install and enable it automaticaly
apt-get install php-zip

"406 Not Acceptable" error when trying to use Composer to install private repo

I'm trying to get my head around the PHP dependency manager Composer, so that I can install a package from a private GitHub repository.
I've followed the instructions about using private repositories for a test repo, and I'm getting a weird 406 error which is:
The requested resource is only capable of generating content not
acceptable according to the Accept headers sent in the request.
The error message is:
$ composer install -n
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing growdigital/access (0.0.3)
Downloading: connection...Failed to download growdigital/access from dist: The "https://github.com/growdigital/access/archive/0.0.3.zip" file could not be downloaded (HTTP/1.1 406 Not Acceptable)
Now trying to download from source
- Installing growdigital/access (0.0.3)
Cloning 464c3a3a580ded3fdaf43a246388b6de33fbac89
So it is working insofar as installing from source rather than the zip. My question really is, how on earth do I address the 406 error? Is there something I need to do to modify composer?

Categories