FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Php Warning: fopen





smokey4life
Anyone have any idea whats going on here? If you need any more info just ask.

Code:
Warning: fopen(/www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/logs/error.php) [function.fopen]: failed to open stream: Permission denied in /www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/libraries/joomla/error/log.php on line 202

Warning: Cannot modify header information - headers already sent by (output started at /www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/libraries/joomla/error/log.php:202) in /www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/plugins/system/remember.php on line 72
Aredon
Code:
Warning: fopen(/www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/logs/error.php) [function.fopen]: failed to open stream: Permission denied in /www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/libraries/joomla/error/log.php on line 202

This is a file permission error. If you look in the direct admin help section it has a listing of file permission codes. It can also be caused by the file owner being wrong. I've had lots of these errors in the past, and there doesn't seem to be any quick fix. Basically just have to play with permissions until you get it to work. Sad

Code:
Warning: Cannot modify header information - headers already sent by (output started at /www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/libraries/joomla/error/log.php:202) in /www/110mb.com/x/t/m/_/_/_/_/_/xtm/htdocs/plugins/system/remember.php on line 72

What likely happened here is that one page set some cookie or had a header already set. Perhaps a HTML doctype? Check both of those pages (on the line numbers given), if you can find a header/cookie set on both then that is what is causing this error. If you absolutely need both of them in place and can't find another way to do it. I believe you can use ob_start() and ob_end_flush() at the start, and end of the page respectively. It *should* get rid of that error.
rvec
Quote:
there doesn't seem to be any quick fix

chmod to 777 will make it work most of the time.

The second error is because there is output send to the browser (the error) and some header modification was done after that. It should normally be gone if the error is gone.
Aredon
rvec wrote:
chmod to 777 will make it work most of the time.

Wouldn't it be better to use 666 on the file instead of 777 on the folder? That way only one file is writable to everyone vs the whole folder having the option of writing whatever you want into it?

Quote:
The second error is because there is output send to the browser (the error) and some header modification was done after that. It should normally be gone if the error is gone.
Hmm that's very possible. I guess try fixing the permission error first, and if you still have problems with headers go ahead and use ob_start() and ob_end_flush(). I just double checked some of my older stuff and I found that I had used this before to fix a header problem with cookies and a redirect. So I'm 90% sure it should work for you.


Edit: Holy crap post #500 :O
rvec
why 666? That's read+write?
it would work just as good as 777 because you don't need execute, but there's really no difference.
And I didn't say the dir, I said "it" and meant chmod the file to 777.

Quote:
Hmm that's very possible. I guess try fixing the permission error first, and if you still have problems with headers go ahead and use ob_start() and ob_end_flush(). I just double checked some of my older stuff and I found that I had used this before to fix a header problem with cookies and a redirect. So I'm 90% sure it should work for you.

If it isn't the error that's causing it you should rewrite the script, because using output-buffering is ugly and makes your script unreadable.
Related topics
PHP Write to line
Question about MySQL!
My upgraded message board
an annoying problem - PLEASE help
site colse/open with php
Jak oceniacie wortal graczy www.gryok.info
PHP upgrade?
i did a 755 on all files and it doesent help
from excel to php ?
PHP fopen
i cannot open a file with fopen()
Cronjob Fopen() Problem
fopen() Issue. Extremely Urgent!
PHP Sending Attachment Email
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.