Re: using fopen() in write mode is failing
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Sat, 31 May 2008 08:52:04 -0400
cscorley@xxxxxxxxx wrote:
On May 30, 3:08 pm, cscor...@xxxxxxxxx wrote:For some reason, I cannot use fopen() on the file in write mode. The
file "time" is in the same directory as the .php file, with
permissions set to 0766.
PHP Version 5.2.5
Apache/2.2.8
code snip in question:
$file = "time";
function updateParseTime($name){
global $file;
if (file_exists($name) && file_exists($file)) {
if(($fp = fopen($file,"wb"))){
$lastmod = filemtime($name);
if(!(fwrite($fp, $lastmod))){
echo "cannot update time";
}
}
else{
echo "$file cannot be opened. \n";
}
}
else{
echo "$name or $file not found.";
}
}
on the 4th line it fails the if check ($fp = fopen...) and just
outputs "$file cannot be opened"
Am I missing something?
Actually, I think it must have something to do with the way this
particular webserver is setup (be it apache/php), because it works
fine when tested on another server (not maintained by me).
What OS is it running on (i.e. if Linux, which distro)? It could be the OS security isn't allowing it, despite the file flags.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: using fopen() in write mode is failing
- From: Rik Wasmus
- Re: using fopen() in write mode is failing
- References:
- using fopen() in write mode is failing
- From: cscorley
- Re: using fopen() in write mode is failing
- From: cscorley
- using fopen() in write mode is failing
- Prev by Date: Re: using fopen() in write mode is failing
- Next by Date: Re: Interactive mode not very useful
- Previous by thread: Re: using fopen() in write mode is failing
- Next by thread: Re: using fopen() in write mode is failing
- Index(es):
Relevant Pages
|