-
Junior Member
why i have this prob.
simple php code, working at every host, but here i have problems :(, maybe any 1 can help.
code:
-------------------------------------------
$filename = "mail.txt";
if(!file_exists($filename))
{
echo ("create file:$filename
");
$fp = @fopen($filename, "w");
fputs ($fp, $killmail);
@fclose ($fp);
}
-------------------------------------------
and errormessage what showed to me with fputs and fwrite functions:
Warning: fputs(): supplied argument is not a valid stream resource in /hsphere/local/home/..../eve-lc.com/write.php on line 12
how solve problem ?
-
Junior Member
I would start by checking your php.ini file
-
Junior Member
My first guess is a permissions problem.
Are you running this code through a web browser or at the command-line?
If through a web browser then does the user that the webserver is running as (httpd) have access to write to the directory?
If you are the owner of the directory then you will have to give public write access to it (albeit that's not an advised solution on a shared hosting server).
-
Try removing the @ sign before the fopen function call so you actually see the error that was caused by the fopen command. fputs is failing because fopen failed, but the @ sign suppresses the error output.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Bookmarks