PEAR Error

SeLLeRoNe

Super Moderator
Joined
Oct 9, 2004
Messages
6,643
Location
A Coruña, Spain
Hi, i need to instal a pakage with pear but when i download that package and install it i've this error

>pear install Spreadsheet_Excel_Writer-0.9.0.tgz

Warning: main(Console/Getopt.php): failed to open stream: No such file or directory in System.php on line 27

Fatal error: main(): Failed opening required 'Console/Getopt.php' (include_path='/usr/local/lib/php') in /usr/local/lib/php/System.php on line 27


some one can help me'
 
SeLLeRoNe said:
Hi, i need to instal a pakage with pear but when i download that package and install it i've this error

>pear install Spreadsheet_Excel_Writer-0.9.0.tgz

Warning: main(Console/Getopt.php): failed to open stream: No such file or directory in System.php on line 27

Fatal error: main(): Failed opening required 'Console/Getopt.php' (include_path='/usr/local/lib/php') in /usr/local/lib/php/System.php on line 27


some one can help me'

Same kind of error here while trying to install SSH2


pear install ssh2

Warning: main(Console/Getopt.php): failed to open stream: No such file or directory in System.php on line 27

Fatal error: main(): Failed opening required 'Console/Getopt.php' (include_path='/usr/local/lib/php') in /usr/local/lib/php/System.php on line 27

Any help would be great!
I suspect it has something to do with the path to PHP and PEAR since this has been set by DirectAdmin.
 
I have found the problem myself ....

It looks like the problem is caused by DA in combination with PHP and PEAR.
DA is using another path for PHP and PEAR which can give a conflict in some cases.

Here is an example for my system:

Location of PEAR:
/usr/local/directadmin/customapache/php-4.4.2/pear

The "pear install -f ssh2" failed because the directories ./Archive and ./Console could not be found.
These directories DO exist but only in the above path.

I have copied the Archive and Console directories to: /usr/local/lib/php, and run the "pear install -f ssh2" again.
This worked, at least the error message changed....

I have got some other errors which could be solved by using "pecl install -f ssh2".
The php.ini has to edited (/usr/local/lib/php.ini), the path of the extension had to be changed. This has nothing to do with DA but only where the ssh2.so has been stored. In my case I have moved the ssh2.so to /usr/local/lib.

Installation of other packages than ssh2 probably need other entries in the php.ini.
 
Its actually the pear was packaged improerly in php-4.4.2 but amazingly the developers didnt release a fixed version, assumingly they either think this bug dont matter enough or they not bothered about 4.x tree enough.
 
change the following files to fix it

/usr/local/lib/php/System.php
line 27

to the path where Console is

on my machine
/usr/local/directadmin/customapache/php-4.4.2/pear/Console/Getopt.php

instead of
Console/Getopt.php

Doe the same with

/usr/local/lib/php/pearcmd.php
line 67

and change in
/usr/local/lib/php/PEAR/PackageFile.php
line 298

to

/usr/local/directadmin/customapache/php-4.4.2/pear/Archive/Tar.php

worked with me probably a more better way but after alot of other problems this does the trick.

cheers
 
Back
Top