As an exersize in learning I've installed Apache 2, perl, MYSql and PHP on my win XP platform.
I'm having a problem understanding how to get PHP to make use of cat.exe.
Apache error log reports the following:
[Sat Dec 13 12:15:35 2003] [error] [client 127.0.0.1] 'cat' is not recognized as an internal or external command,
[Sat Dec 13 12:15:36 2003] [error] [client 127.0.0.1] operable program or batch file.
I'm gussing that PHP dosen't know that cat.exe is located in:
C://cygwin/bin and I don't know how to define that path or where to do so.
I've searched high and low and most of the documentation I've found relates to specific applications. I think my problem is more configuration related.
Any ideas?
TIA,
Fred K
[Solved] Define path to cat.exe ?
Moderator: General Moderators
Volka, that seems to be the case.
I'm trying to get a script to run. It's called phpgraphy. The portion of the script that seems to be causing the problem follows:
// display .welcome message if it exists
if(is_file($root_dir.$dir.".welcome") && !$display) {
echo "<font color=".$welcomecolor."><pre>";
system("cat \"".$root_dir.$dir.".welcome\"");
/* exec("cat ".$root_dir.$dir.".welcome",$welcome);
for($i=0;$i<sizeof($welcome);$i++)
echo $welcome[$i]."<br>";*/
echo "</pre></font>";
// echo "<br>";
}
It is the first referance to 'cat' in the script.
I suspect that the path to cat.exe is some kind of global value and does not necessarily need to be defined in the script.
Can that be?
Regards,
Fred
I'm trying to get a script to run. It's called phpgraphy. The portion of the script that seems to be causing the problem follows:
// display .welcome message if it exists
if(is_file($root_dir.$dir.".welcome") && !$display) {
echo "<font color=".$welcomecolor."><pre>";
system("cat \"".$root_dir.$dir.".welcome\"");
/* exec("cat ".$root_dir.$dir.".welcome",$welcome);
for($i=0;$i<sizeof($welcome);$i++)
echo $welcome[$i]."<br>";*/
echo "</pre></font>";
// echo "<br>";
}
It is the first referance to 'cat' in the script.
I suspect that the path to cat.exe is some kind of global value and does not necessarily need to be defined in the script.
Can that be?
Regards,
Fred
you can either use the absolute pathor append C:\cygwin\bin to the enviroment variable PATH
Not quite sure wether it's the same for xp as for w2k but try
right click "my computer" -> properties -> advanced -> environment
then add the path to the systemwide setting of PATH (separated from the others by ; )
Code: Select all
system("C:/cygwin/bin/cat.exe "".$root_dir.$dir.".welcome"");Not quite sure wether it's the same for xp as for w2k but try
right click "my computer" -> properties -> advanced -> environment
then add the path to the systemwide setting of PATH (separated from the others by ; )
oops the / was a typo here on the BB. When I appended the path I used \
Just for grins I rebooted and removed the full path from the script and that worked too. I guess XP requires a reboot if you modiify the PATH.
Now I'm having a similar problem with a perl script that makes a call to grep inorder to add the date and time to the bottom of a html page. Seems perl can't find cygwin either.
Fred
Just for grins I rebooted and removed the full path from the script and that worked too. I guess XP requires a reboot if you modiify the PATH.
Now I'm having a similar problem with a perl script that makes a call to grep inorder to add the date and time to the bottom of a html page. Seems perl can't find cygwin either.
Fred