Forum Moderators: coopster
I've just installed pear (and the package manager) on my server, everything went fine and pear changed the php.ini to point to the correct repository for the pear packages.
But when I run "pear install HTML_Common" from the command line I get :-
/usr/bin/pear: /usr/local/bin/php: No such file or directory
which is correct because php is in /usr/bin/php (which I correctly configured for the install)
Does anyone now how to correct the path that pear is using?
Thanks
Andy
<?
//print the names of files containing a specified string
function find_in_folder($folder,$string)
{
global $noMatchFound;
$folderHandle = opendir($folder);
if($folderHandle)
{
while ( ($folderAsset = readdir($folderHandle) )!== false)
{
if ( $folderAsset!=".." && $folderAsset!="." )
{
$assetPath = "$folder/$folderAsset";
if(is_dir($assetPath) &&!is_link($assetPath) )
{
find_in_folder($assetPath,$string);
}elseif(!is_link($assetPath) ){
$fileText = file_get_contents($assetPath);
if( strstr($fileText,$string) )
{
echo "$assetPath\n";
$noMatchFound=false;
}
}
}
}
closedir($folderHandle);
}
}
$noMatchFound=true;
//change the following variables as needed
$startFolder = "/etc";
$searchString = "usr/local/bin/php";
find_in_folder($startFolder,$searchString);
if($noMatchFound)
{
echo "No match was found\n";
}
?>
Best regards!
Michal Cibor
PS. Thanks jezra for the interesting code!
Because PEAR is properly installed I've got round the problem with the package manager by downloading the appropriate packages directly from pear and then manually installing them in the correct pear sub-directory.
This all seems to be working fine, but if anyone knows why I shouldn't be doing this please let me know.
I just kind of corrected my mc with that. I couldn't write polish letters under Mandrake 10.1, but I could under Aurox. So I copied some ini and conf files from the Aurox version into the Mandrakes, as well as the program file (mc). Certainly there was some problem with libraries, so I copied the program file back to the original version of Mandrake. You can imagine my surprise when I found that polish letters are working now! l -> ³, etc. :)
So as you see, your way is much better!
Best wishes!
Michal Cibor
Because pear is properly installed I've got round the problem with the package manager by downloading the appropriate packages directly from pear and then manually installing them in the correct pear sub-directory.This all seems to be working fine, but if anyone knows why I shouldn't be doing this please let me know.
I ran into this problem recently on a RHES installation. Could not figure out for the life of me why everything is in place but the pear command wouldn't run anything. It would run, but no errors, no listings, no installs, no nothing would occur. I mean, if I keyed in "pear remote-list" the command would run but would return nothing. Just straight back to the bash prompt.
Well, I peeled open the bash script and started running the command using the command line switches shown in the *exec* line of the script. It came down to eliminating the INCARG parm from the command:
#exec $PHP -C -q $INCARG -d output_buffering=1 $INCDIR/pearcmd.php "$@"
exec $PHP -C -q -d output_buffering=1 $INCDIR/pearcmd.php "$@"
can you do a
grep 'INCARG' on that script for me, tell me what it's setting it to? Then maybe do an echo $INCARG right before that line you posted? I'm now curious... :) Matt
our reference for this by the way was here
[php.net...]
Echo them out? Oh yeah, no problem. I echoed the values out for myself to see what they were when I was troubleshooting this animal. INCARG is being set to the very last value in the if/else structure which in this installation happens to be:
/usr/local/lib/php
The value of $PHP is the path to the binary
/usr/local/bin/php
PHP = /usr/local/bin/php
INCDIR = /usr/local/lib/php
INCARG = -d include_path=/usr/local/lib/php
it would look like this
exec /usr/local/bin/php -C -q -d include_path=/usr/local/lib/php -d output_buffering=1 /usr/local/lib/php/pearcmd.php "$@"
and 2 -d's won't work methinks, though this might
exec /usr/local/bin/php -C -q -d include_path=/usr/local/lib/php output_buffering=1 /usr/local/lib/php/pearcmd.php "$@"
<added>actually looking at that this might even work
exec /usr/local/bin/php -C -q -d include_path=/usr/local/lib/php output_buffering=1 pearcmd.php "$@"
php -C -q -d include_path=c:\php -d output_buffering=1 c:\php\pear\pearcmd.php remote-list