Current location: Hot Scripts Forums » Programming Languages » PHP » fopen error


fopen error

Reply
  #1 (permalink)  
Old 01-02-06, 10:38 PM
Runeman Runeman is offline
Newbie Coder
 
Join Date: Dec 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
fopen error

I am getting the following errors on my entry page: www.inetguides.com


Warning: fopen(/home/inetguid/public_html/news/data/news.txt): failed to open stream: Permission denied in /home/inetguid/public_html/news/inc/functions.inc.php on line 67

Warning: fclose(): supplied argument is not a valid stream resource in /home/inetguid/public_html/news/inc/functions.inc.php on line 68

Warning: fopen(/home/inetguid/public_html/news/data/comments.txt): failed to open stream: Permission denied in /home/inetguid/public_html/news/inc/functions.inc.php on line 69

Warning: fclose(): supplied argument is not a valid stream resource in /home/inetguid/public_html/news/inc/functions.inc.php on line 70

Warning: fwrite(): supplied argument is not a valid stream resource in /home/inetguid/public_html/news/inc/functions.inc.php on line 76


The code starting with line 67 and ending with line 76:


$handle = fopen("$cutepath/data/news.txt","w") or $error = "Can not open news.txt";
fclose($handle);
$handle = fopen("$cutepath/data/comments.txt","w") or $error = "Can not open comments.txt";
fclose($handle);


$fp = @fopen("$cutepath/data/auto_archive.db.php", "w");
@flock ($fp,2);

if(!$errors){ fwrite($fp, $now[year]."|".$now[month]."\n"); }

I have tried changing the permissions for the path in question in cpanel to 666, 755, and 751 with no change other than getting different error messages.

I am still new to all this and learning so any help at all is appreciated.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-02-06, 10:42 PM
Christian's Avatar
Christian Christian is offline
Community VIP
 
Join Date: Mar 2005
Location: ProgrammingTalk
Posts: 2,449
Thanks: 0
Thanked 6 Times in 5 Posts
try changing it to 777
Reply With Quote
  #3 (permalink)  
Old 01-03-06, 02:59 AM
knine143 knine143 is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
he means to chmod the file you're trying to open to 777 in case that wasn't clear. This can be done with many ftp clients such as SmartFTP or if you're using a webhoster it probably provides the capability as well.
Reply With Quote
  #4 (permalink)  
Old 01-04-06, 11:31 AM
Christian's Avatar
Christian Christian is offline
Community VIP
 
Join Date: Mar 2005
Location: ProgrammingTalk
Posts: 2,449
Thanks: 0
Thanked 6 Times in 5 Posts
Quote:
Originally Posted by Runeman
I have tried changing the permissions for the path in question in cpanel to 666, 755, and 751 with no change other than getting different error messages.
I think he knew what I was talking about.
Reply With Quote
  #5 (permalink)  
Old 01-04-06, 05:48 PM
knine143 knine143 is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Ya probably
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
fopen error - Cannot continue after ! learner PHP 5 10-01-05 06:17 PM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
Error: 500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown error) padmanaban_bala Perl 2 05-03-05 05:00 PM
[php error] parse error | fatal error xeoHosting PHP 1 01-03-04 08:12 PM


All times are GMT -5. The time now is 06:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.