5
votes

I'm trying to install PHPUnit using PEAR. Whatever command i run like pear install phpunit/PHPUnit, pear install Structures_Graph, pear upgrade, pear upgrade --force --alldeps... it always ends with

Warning: require_once(Structures/Graph/Node.php): failed to open stream: No such file or directory in PEAR\Structures\Graph.php on line 37 PHP Warning: require_once(Structures/Graph/Node.php): failed to open stream: No such file or directory in C:\wamp\bin\php\php5.3.4\PEAR\PEAR\Structures\Graph.p hp on line 37

Warning: require_once(Structures/Graph/Node.php): failed to open stream: No such file or directory in C:\wamp\bin\php\php5.3.4\PEAR\PEAR\Structures\Graph.php on line 37 PHP Fatal error: require_once(): Failed opening required 'Structures/Graph/Node .php' (include_path='C:\wamp\bin\php\php5.3.4\pear') in C:\wamp\bin\php\php5.3.4 \PEAR\PEAR\Structures\Graph.php on line 37

Fatal error: require_once(): Failed opening required 'Structures/Graph/Node.php' (include_path='C:\wamp\bin\php\php5.3.4\pear') in C:\wamp\bin\php\php5.3.4\PEAR \PEAR\Structures\Graph.php on line 37

I tried the answer to this question and downloaded and extracted the ZIP to C:\wamp\bin\php\php5.3.4\PEAR\PEAR, but that only replaces the Structures_Graph error I had before with this one.

PEAR is installed with go-pear.bat on a wamp installation on Windows 7, PHP 5.3.4.

What more can I try to make this work?

Update: It should be said that I've tried to change the include_path reported in the error above, to no success. Tried to alter both php.ini and pear.bat.

5
Did you end up finding a solution to this?Keyo
Sorry, I have not had the time to pursue this further yet. I think I may have gone around this problem before by installing PHPUnit manually.Znarkus
I found that the version of go-pear.phar that comes with WAMP is rotten. I downloaded a new version of pear(1.9.2), replaced that file and installed it as per normal. I had a lot of problems with %PATH% but eventually it worked after restarting.Keyo
Do you have a file Structures/Graph/Node.php? Which full path has it?cweiske
I have the same problem and tried all the solutions you give but not works. Anybody can solve this?emeraldhieu

5 Answers

5
votes

I found that the version of pear (go-pear.phar) which comes with wamp is basically broken.

Downloading a fresh go-pear.phar file from pears website worked for me.

2
votes

When I installed the files it installed some of them in path c:\wamp\bin\php\php5.3.5\PEAR\pear\PEAR\, among the files there was the Structures directory. I simply copied all the files one direcotyr up to c:\wamp\bin\php\php5.3.5\PEAR\pear\ and the problem has been resolved, at least for me

1
votes

Set your include path to

C:\wamp\bin\php\php5.3.4\PEAR\PEAR\

Better start all over because that setup seems to be fckd up.

0
votes

I tried all of the above with no luck. What I had to do was edit all paths and add "PEAR/".

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';
0
votes

C:/wamp/bin/php/php5.3.8/PEAR/ you should change to a complete path example:

require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph.php'

Change this in

Graph.php

require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph/Node.php';
Node.php

require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph.php';
AcyclicTest.php

require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph.php';
require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph/Node.php';
TopologicalSorter.php

require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph.php';
require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph/Node.php';
require_once 'C:/wamp/bin/php/php5.3.8/PEAR/PEAR/Structures/Graph/Manipulator/AcyclicTest.php';

Pear not found the path to Graph.php ect.