5

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.

Community
  • 1
  • 1
Markus Hedlund
  • 23,374
  • 22
  • 80
  • 109
  • Did you end up finding a solution to this? – Benbob Apr 26 '11 at 22:37
  • 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. – Markus Hedlund Apr 27 '11 at 11:41
  • 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. – Benbob Apr 27 '11 at 20:55
  • Do you have a file `Structures/Graph/Node.php`? Which full path has it? – cweiske May 02 '11 at 06:42
  • I have the same problem and tried all the solutions you give but not works. Anybody can solve this? – emeraldhieu May 31 '11 at 10:51
  • Answer for this is found here: [http://stackoverflow.com/questions/4717547/cant-install-pear-on-windows-7-structures-graph-error][1] [1]: http://stackoverflow.com/questions/4717547/cant-install-pear-on-windows-7-structures-graph-error – qais Sep 17 '11 at 17:11
  • @qais: Thanks, but I stated in my question that that solution did not work for me. – Markus Hedlund Sep 18 '11 at 12:29

5 Answers5

5

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.

Benbob
  • 13,876
  • 18
  • 79
  • 114
  • Nice, will [check it out](http://pear.php.net/manual/en/installation.getting.php) – Markus Hedlund Apr 28 '11 at 22:41
  • Hi, I'm still stuck in this problem. I did it as above: downloading a new go-pear.phar and put it in PEAR folder. It still says "Warning: require_once(Structures/Graph/Node.php)..." – emeraldhieu May 31 '11 at 09:06
  • Also make sure you're using 32 bit wamp. That might help. – Benbob May 31 '11 at 22:40
  • Yes, that is why I suggest you try it. Possibly also a system path issue. I no longer use the computer I set wamp up on, so I can't really tell you much about how I set it up. – Benbob Jun 01 '11 at 07:55
2

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

Emil
  • 21
  • 1
1

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.

cweiske
  • 30,033
  • 14
  • 133
  • 194
  • I've tried to change the include_path, but PEAR doesn't read this new (see "Update:"). I've tried this on two computers with the same result – Markus Hedlund Apr 20 '11 at 21:00
0

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';
moleculezz
  • 7,513
  • 4
  • 25
  • 25
0

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.

McGarnagle
  • 101,349
  • 31
  • 229
  • 260