open file in linux box

#1
[eluser]Sub-Zero[/eluser]
Hi!

I wrote this script before in Windows and it works perfect. Now, my office decided to migrate everything into a redhat box running apache. I changed the windows path to the linux path and I'm getting an error msg. Any suggestions? BTW, the folder is set up with the following permissions: 755.

Here is a sample code:
$logfileHeader ='<DOCTYPE html PUBLIC...';

$logfile = "visitor.html";
$dir = "/usr/local/apache/htdocs/sample1/system/logger";
$location = $dir.'/'.$logfile;

if(!file_exists($location)){
$logfile = fopen("$location", "w") or die('Cannot write to file');
fwrite($logfile, $logfileHeader);
}
else{
$logfile = fopen($savelocation, "a");
}
fwrite($logfile, $logEntry);
fclose($logfile);


Messages In This Thread
open file in linux box - by El Forum - 09-16-2009, 09:21 AM
open file in linux box - by El Forum - 09-16-2009, 11:44 AM
open file in linux box - by El Forum - 09-16-2009, 12:17 PM
open file in linux box - by El Forum - 09-16-2009, 04:46 PM
open file in linux box - by El Forum - 09-16-2009, 05:01 PM
open file in linux box - by El Forum - 09-16-2009, 06:22 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.