Composer neither installing nor updating RecursiveDirectoryIterator Cannot find path specified - composer-php

I have been trying to update / install with composer on my windows7 64 bit machine. But lately I am getting this errors:
$ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing zendframework/zendxml (dev-master 559b34f)
Cloning 559b34f426d33a11c3db118e00ce14bb8dc64e5f
Failed to download zendframework/zendxml from source: RecursiveDirectoryIterator
::__construct(C:\wamp\www\projects\vendor\zendframework\zendxml,C:\wamp\www\projects\vendor\zendframework\zendxml): The system cannot find the path specified. (
code: 3)
Now trying to download from dist
- Installing zendframework/zendxml (dev-master 559b34f)
Downloading: 100%
[UnexpectedValueException]
RecursiveDirectoryIterator::__construct(C:\wamp\www\projects\vendor/zendfra
mework/zendxml,C:\wamp\www\projects\vendor/zendframework/zendxml): The syst
em cannot find the path specified. (code: 3)
I have tried to remove the vendor directory as well as empty the composer cache but this didn't solve the issue.
Any suggestions?

My problem was that I moved a directory which enabled colors in cmd.exe. Now the directory was not linked properly anymore.
Check out https://getcomposer.org/doc/articles/troubleshooting.md#-the-system-cannot-find-the-path-specified-windows- and also check for invalid paths.

Maybe a write permisions error in the vendor's folder.
Stop Apache and delete the folder /vendor/zendframework and run again composer install.

Related

How to fix library dependence in a conan package

I am trying to install qt/5.14.2 with conan.
Using
qt/5.14.2#bincrafters/stable
I receive
ERROR: libpq/11.5: Error in package_info() method, line 211
self.cpp_info.components["pq"].requires.append("zlib::zlib")
AttributeError: 'Component' object has no attribute 'requires'
OK, there is a bug in libpq/11.5
I am trying to downgrade to
libpq/11.4#bincrafters/stable
ERROR: Conflict in qt/5.14.2#bincrafters/stable:
'qt/5.14.2#bincrafters/stable' requires 'zlib/1.2.11' while 'libpq/11.4#bincrafters/stable' requires 'zlib/1.2.11#conan/stable'.
To fix this conflict you need to override the package 'zlib' in your root package.
BTW:
Why is it not enough to require the correct version of the library, and requiring the same repository? (and require two different repositories in two different packages for the same dependence)
OK, I attempted
zlib/1.2.11#bincrafters/stable
WARN: libpq/11.4#bincrafters/stable: requirement zlib/1.2.11#conan/stable overridden by your conanfile to zlib/1.2.11#bincrafters/stable
zlib/1.2.11#bincrafters/stable: Not found in local cache, looking in remotes...
zlib/1.2.11#bincrafters/stable: Trying with 'conan-center'...
zlib/1.2.11#bincrafters/stable: Trying with 'minres'...
zlib/1.2.11#bincrafters/stable: Trying with 'bincrafters'...
ERROR: Failed requirement 'zlib/1.2.11#bincrafters/stable' from 'libpq/11.4#bincrafters/stable'
ERROR: Unable to find 'zlib/1.2.11#bincrafters/stable' in remotes
Finally, I arrived at
libpq/11.4#bincrafters/stable
zlib/1.2.11#conan/stable
qt/5.14.2#bincrafters/stable
After this, it looks like it was oK:
Installing (downloading, building) binaries...
qt/5.14.2#bincrafters/stable: Retrieving package 93c70de10405da9f2d5a1f42b8c299ca7af869d2 from remote 'bincrafters'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
....qt/5.14.2#bincrafters/stable: Package installed 93c70de10405da9f2d5a1f42b8c299ca7af869d2
qt/5.14.2#bincrafters/stable: Downloaded package revision 0
However, the install fails with
CMake was unable to find Qt5, put qmake in your path or set
QTDIR/QT_QMAKE_EXECUTABLE.
The package is downloaded, I see all components in the corresponding subdirectory in my home directory. However, unlike the other components, it is not installed, before CMake attempts to find it.
What do I wrong?
In case of any strange behavior of conan, upgrade! For me, switch 1.24.0 -> 1.28.1 with configs clean up fixed the same problem with libpq/11.5

how to install package with composer?

I am trying to install a push-notification library for codeigniter using composer fromhere .But when i do run a command it throws this error -> Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for wrep/notificato ^1.2 -> satisfiable by wrep/notificato[1.2.0].
- wrep/notificato 1.2.0 requires ext-sockets * -> the requested PHP extension sockets is missing from your system.
To enable extensions, verify that they are enabled in your .ini files:
- E:\xampp\php\php.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
I also did commented the php.ini extension=php_intl.dll and also its the same error occuring. How can i solve this?

Composer: Your requirements could not be resolved to an installable set of packages

I am trying to install a composer package and I continuously get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package rondobley/extended-respect-validation could not be found in any version, there may be a typo in the package name.
Here is the composer.json
{
"minimum-stability": "dev",
"require": {
"rondobley/extended-respect-validation": "^1.0"
}
}
And the output from composer install -vvv:
vagrant#wheezy:/code/test$ composer install -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/code/test): git branch --no-color --no-abbrev -v
Executing command (/code/test): git describe --exact-match --tags
Executing command (/code/test): git log --pretty="%H" -n1 HEAD
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Running 1.2.0 (2016-07-19 01:28:52) with PHP 5.5.38-1~dotdeb+7.1 on Linux / 3.2.0-4-amd64
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015-10.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-01.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-04.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-07.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Resolving dependencies through SAT
Dependency resolution completed in 0.001 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package rondobley/extended-respect-validation could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
The package seems to be fine to me:
https://packagist.org/packages/rondobley/extended-respect-validation
It is a new package, just published today, but it has been several hours. I have also tried composer clearcache and that does not help. I have read many of the other similar issues here with no luck. I am new to publishing composer packages, so maybe I an missing a simple step?
Ideally I would like to install version ^1.0.
Thanks for the help in advance.
See https://twitter.com/packagist/status/772034610632990720 - it was a temporary failure on packagist

PHPUnit instllation broken since Mountain Lion upgrade

I upgraded my Mac from Lion to Mountain Lion a few months ago.
I previously had PHPUnit working with my Zend Framework 1.11 without issue but had not used it much.
I now have Zend Framewoprk 2 running on a Quick Start website but I simply cannot gwet PHPUnit to work.
I've searched numerous questions related to this on Stackoverflow and tried reinstalls and path changes to php.ini without success.
I have also checked that my PEAR install is working fine, which it is but the error is the same when I try "phpunit --version"
PHP Warning: require(/usr/lib/php/PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 43
Warning: require(/usr/lib/php/PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 43
PHP Fatal error: require(): Failed opening required '/usr/lib/php/PHPUnit/Autoload.php' (include_path='.:/Users/johnadmin/pear/share/pear/PEAR:/Users/johnadmin/pear/share/pear:/usr/bin/phpunit:/Users/johnadmin/pear/share/pear/PHPUnit:/usr/bin/phpunit:/Users/johnadmin/pear/bin/pear') in /usr/bin/phpunit on line 43
Fatal error: require(): Failed opening required '/usr/lib/php/PHPUnit/Autoload.php' (include_path='.:/Users/johnadmin/pear/share/pear/PEAR:/Users/johnadmin/pear/share/pear:/usr/bin/phpunit:/Users/johnadmin/pear/share/pear/PHPUnit:/usr/bin/phpunit:/Users/johnadmin/pear/bin/pear') in /usr/bin/phpunit on line 43
Attempts to reinstall phpunit results in me been told phpunit is already installed and its version current.
$ sudo pear install phpunit/PHPUnit
phpunit/PHPUnit is already installed and is the same as the released version 3.7.10
install failed
Trying to uninstall fails as phpunit is a dependancy in other items/applications.
Is there anyway I can fix this or completely remove it and reinstall fresh?
include_path in my php.ini is:
include_path=".:/Users/johnadmin/pear/share/pear/PEAR:/Users/johnadmin/pear/share/pear:/usr/bin/phpunit:/Users/johnadmin/pear/share/pear/PHPUnit:/usr/bin/phpunit:/Users/johnadmin/pear/bin/pear"
Additional info in case its relevant:
> which phpunit
/usr/bin/phpunit
> which pear
/Users/johnadmin/pear/bin/pear
> which php
/usr/bin/php
Autoload.php is located in
/Users/johnadmin/pear/share/pear/PHPUnit
Additionally, the folder '/usr/lib/php/' exists but the PHPUnit directory is not under that, it is under /Users/johnadmin/pear/share/pear/PHPUnit
bash_profile content/paths
PATH=$PATH:/usr/local/Cellar/imagick/3.0.1:/usr/local/sbin:/Users/johnadmin/pear/share/pear:$
##
# Your previous /Users/johnadmin/.bash_profile file was backed up as /Users/johnadmin/.bash_$
##
# MacPorts Installer addition on 2012-04-17_at_08:37:29: adding an appropriate PATH variable$
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
##
# Your previous /Users/johnadmin/.bash_profile file was backed up as /Users/johnadmin/.bash_$
##
# MacPorts Installer addition on 2012-10-09_at_16:09:32: adding an appropriate PATH variable$
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
##
# Your previous /Users/johnadmin/.bash_profile file was backed up as /Users/johnadmin/.bash_$
##
# MacPorts Installer addition on 2012-12-06_at_13:40:25: adding an appropriate PATH variable$
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
At my wits end as I do not know what else to check frankly and any help would be a big help. Ta
John
Nevermind after hours of trying various solutions I found that creating a simlink to the PHPUnit folder worked.
Command I used was
sudo ln -s /Users/johnadmin/pear/share/pear/PHPUnit /usr/lib/php/PHPUnit
Seriously, this helped me a lot:
Install Composer (http://getcomposer.org)
composer require phpunit/phpunit 3.7.*
composer update
Three simple steps to pull PHPUnit source, and binary to your project.

Can't install PEAR on Windows 7, Structures/Graph error

I just did a clean install of Windows 7. I've installed Apache, Mysql
and PHP 5.3.5 all separated (not using XAMPP/others).
I'm getting the following error in the install: ERROR: unable to unpack phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar
The full stack trace is:
C:\Web\php-5.3.5>go-pear.bat
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : system
Below is a suggested file layout for your new PEAR installation. To change individual locations, type the number in front of the directory. Type 'all' to change all of them or simply press Enter to accept these locations.
1. Installation base ($prefix) : C:\Web\php-5.3.5
2. Temporary directory for processing : C:\Web\php-5.3.5\tmp
3. Temporary directory for downloads : C:\Web\php-5.3.5\tmp
4. Binaries directory : C:\Web\php-5.3.5
5. PHP code directory ($php_dir) : C:\Web\php-5.3.5\pear
6. Documentation directory : C:\Web\php-5.3.5\docs
7. Data directory : C:\Web\php-5.3.5\data
8. User-modifiable configuration files directory : C:\Web\php-5.3.5\cfg
9. Public Web Files directory : C:\Web\php-5.3.5\www
10. Tests directory : C:\Web\php-5.3.5\tests
11. Name of configuration file : C:\Web\php-5.3.5\pear.ini
12. Path to CLI php.exe : C:\Web\php-5.3.5
1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\Web\php-5.3.5\pear.ini...
Initialized registry...
Preparing to install...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.3.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.8.0.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...
install ok: channel://pear.php.net/Archive_Tar-1.3.3
install ok: channel://pear.php.net/Console_Getopt-1.2.3
ERROR: unable to unpack phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.8.0
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's' PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
** WARNING! Old version found at C:\Web\php-5.3.5, please remove it or be sure t
o use the new c:\web\php-5.3.5\pear.bat command
The 'pear' command is now at your service at c:\web\php-5.3.5\pear.bat
* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under C:\Web\php-5.3.5\PEAR_ENV.reg .
This file creates ENV variables for the current user.
Double-click this file to add it to the current user registry.
C:\Web\php-5.3.5>
After days of googling I've found an answer. Here is it. How to solve:
With admin permission (start cmd with admin privileges):
Run the go-pear.bat that comes with the default PHP installation. It'll installs PEAR, but it's going to generate an error when installing Structures_Graph. IMO Pear needs this package to generate the package dependency (graph), since it's missing it not allow us to install or upgrade any other package.
Download and uncompress Structures_Graph from the pear.php.net website (direct link). Then copy the Structure folder into the PEAR folder. The archive has three folders: docs, Structures, tests. We only need the Structures one. Copy the Structures folder to your PHP_ROOT_DIRECTORY\PEAR directory. So if you installed PHP on C:\Web\php-5.3.5 copy the Structures folder to C:\Web\php-5.3.5\PEAR\, the result should be: C:\Web\php-5.3.5\PEAR\Structures
Do pear install Structures_Graph. Even though the files are present, Structures_Graph is not really installed (we had a problem during installation). So we need to run the command above.
Do pear upgrade PEAR. This upgrades PEAR itself to the current version.
Do pear upgrade Console_Getopt. This upgrades Console_Getopt to the current version and now we can manage and install any pear package.
Marcos Roriz solution does indeed work, but to clarify point 2:
The uncompressed "Structures" folder (inside the tgz) needs to be placed inside the folder: "PEAR\pear" -> e.g. C:\wamp\bin\php\php5.3.5\PEAR\pear
This is a combination of the things you need to do and a couple of new tweaks. Worked on WinXP Pro with WAMP (Wampserver 2.2.1)
Change your go-pear.bat file:
#ECHO OFF
set PHP_BIN=php.exe
%PHP_BIN% -d output_buffering=0 -d phar.require_hash=0 PEAR\go-pear.phar
pause
Run it - go-pear.bat
Now you've go a Pear install with a missing graph.php
Download and uncompress Structures_Graph from the pear.php.net website. Copy the Structure folder into the PEAR folder so that the key files are located as such:
PEAR\Structures\Graph.php
PEAR\Structures\Graph\Node.php
Change this line in Node.php:
require_once '/Structures/Graph.php';
Execute in the PEAR directory:
pear upgrade=all
That did it for me.
First of all, run as administrator.
Then - try to write something in target directory in the console to isolate any remaining permissions problems.
I've been having many issues after upgrading my wampserver which now comes with php 5.3.5.
I have solved the problem by installing php 5.3.0 alongside and using it to run the installer found at http://pear.php.net/go-pear. I set the php cli setting to the php5.3.5 folder without any issues.
This might be wampserver specific. To gauge if you are experiencing a similar problem here are some of the issues I encountered:
Using the go-pear.bat packaged with php5.3.5 i had the same unable to unpack error as the original poster.
Using the go-pear.bat packaged with php5.3.0 i was able to complete the installation but the pear installer was v1.8.0
Using the installer on the pear site mentioned previously with php5.3.5 i had an error "Warning: rmdir(D:\temp): Directory not empty in D:\go-pear.php on line 1237". Looking at the stack trace the Archive_Tar class was throwing an error and the installer was failing to clean up after itself.
the web frontend not write correct paths to pear.ini
ig phph setting is magic_quotes_gpc = On
its doubles all slashes "\" in paths to "\" is it a bug ?
Than the packages for example can be unpacked (wrong paths ?)
"unable to unpack" Message when installing packages
http://pear.php.net/bugs/bug.php?id=18212
I tried all of the above with no luck. After downloading and extracting the "Structures" folder I had to edit all paths and add "PEAR/". Then I was able to do "pear install Structures_Graph" and then "pear upgrade-all"
Graph.php
require_once 'PEAR/Structures/Graph/Node.php';
Node.php
require_once 'PEAR/Structures/Graph.php';
AcyclicTest.php
require_once 'PEAR/Structures/Graph.php';
require_once 'PEAR/Structures/Graph/Node.php';
TopologicalSorter.php
require_once 'PEAR/Structures/Graph.php';
require_once 'PEAR/Structures/Graph/Node.php';
require_once 'PEAR/Structures/Graph/Manipulator/AcyclicTest.php';

Resources