elrohir
May 19 2006, 05:51 PM
I had a script that was working just fine untill yesterday, when something freaked out with an fopen() I used in a login process (to add the user to the active users list). I think my host must have upgraded version and has not changed the permissions in php.ini to allow normal users to access such simple functions. The code I am using is really as basic as you can get: CODE if (!file_exists($file)){ $fh = fopen($file, 'w') or die("can't open file"); $write = $username.':'.$remote;
fwrite($fh, $write); fclose($fh); }
it returns: - Warning: fopen(file.php): failed to open stream: Permission denied in /path/file.txt on line X Warning: fwrite(): supplied argument is not a valid stream resource in /path/file.txt on line X Warning: fclose(): supplied argument is not a valid stream resource in /path/file.txt on line X - Any ideas how to get round this? I do not have all that much experience with other methods - only ever needed 'w' - but it worked before. Thanks in advance /elrohir/
Reply
jlhaslip
May 19 2006, 11:48 PM
try to alter the file's permissions to world write, ie: 777 using the chmod command.
Reply
elrohir
May 20 2006, 12:17 PM
returns the error Warning: chmod(): Operation not permitted in /path/file.php on line X as well as the previous errors... I have contacted the support - hopes up high - as it I do not seem to have any permissions whatsoever, which really is freaking me out  ... We will se...
Reply
Avalon
May 20 2006, 02:50 PM
I assmue you have declared the $file variable somewhere? e.g. $file = file.php Without this it will not work.
Reply
elrohir
May 20 2006, 02:54 PM
well, yeah... As I said, I did not change the source, and suddenly it started giving funky error messages... I think I would have figured out if I had not set $file... but thanks for checking
Reply
ghostrider
Jun 13 2006, 01:12 AM
QUOTE Warning: fopen(file.php): failed to open stream: Permission denied in /path/file.txt on line X
Warning: fwrite(): supplied argument is not a valid stream resource in /path/file.txt on line X
Warning: fclose(): supplied argument is not a valid stream resource in /path/file.txt on line X I think the best thing you can do is talk to your host about file permissions, I had to do that with my last host and he did it write a way. Once your file permissions are solved then all 3 errors should go away.
Reply
elrohir
Jun 13 2006, 02:31 PM
Yeh, I asked them about it, and aftera couple attempts they fixed it
Reply
Recent Queries:--
permissions in php fopen - 10.20 hr back. (1)
-
php fopen error - 120.13 hr back. (2)
Similar Topics
Keywords : php, fopen, error, prob, permissions, php, fopen
- The True Story Of The Internet (without Error)
video about the development of Internet (0)
Forum Script Error
(3) hey, im getting this error when im trying to view a message on my forum, QUOTE Parse error:
syntax error, unexpected T_VARIABLE in /home/luki/public_html/forum/viewtopic.php on line 26 and
this is what is on line 26 in that file.. i don't know waht's wrong with it. QUOTE
LIMIT$start, ".$board_config ; and this is what it loks like all together... QUOTE
define('IN_PHPBB', true); define('IN_CASHMOD', true); define('CM_VIEWTOPIC',
true); LIMIT$start, ".$board_config ; $cm_viewtopic->generate_column....
Http Error Messages
Reference Material (0) QUOTE 100 Continue Only a part of the request has been received by the server, but as long
as it has not been rejected, the client should continue with the request 101 Switching Protocols
The server switches protocol 200 OK The request is OK 201 Created The request is complete,
and a new resource is created 202 Accepted The request is accepted for processing, but the
processing is not complete 203 Non-authoritative Information 204 No Content 205 Reset
Content 206 Partial Content 300 Multiple Choices A link list. The user can....
Gmail: 502 Server Error
GMail: 502 Server Error (20) Hey The topic name says it all. Well I have been trying for the last half an hour to log into my
GMail account, but it kept on occuring a Server 502 error. Just wondering if it is just me
or....yeah. QUOTE Server Error The server encountered a temporary error and could not complete
your request. Please try again in 30 seconds. Yep I have tried every minute..for the last half
an hour...(The Time now is 12.13pm Australian Eastern Standard Time) ....
Awesome 404 Error
(9) 404 rofl The link is a swf for a 404 (page not found) error, I thought it was pretty funny and
thought I'd share it Edited as reported. ....
I Have Ipb Error But It Doesn't Make Sense
php programmers plz look (1) $lang = array ( 'settings_reptrack' => "Inform you if your reputation was
changed?", //2.0.2 'm_blog' => "Community Blog", 'm_blog_ucp_main' => "Your
Blog Settings", 'm_blog_cblocks' => "Content Blocks Settings", 'm_blog_aboutme' =>
"About Me Settings", 'm_blog_your_blog' => "Your Blog", //2.0 //D2-My Main Page
'mmp_title' => "My Main Page", 'mmp_current' => "My Current Main Page",
'mmp_change' => "Change My Main Page", 'mmp_no_pages' => "There Currently Isn't
Any Pages....
!help! Error On Ipb Forums! Help!
(3) http://www.hostjunkies.trap17.com/forums/i...php?showtopic=5 mysql! error! i dont know
what happened? if you can help please post here....if u cant click link this is what it says QUOTE
mySQL query error: SELECT p.*, m.id,m.name,m.mgroup,m.email,m.joined,m.posts, m.last_visit,
m.last_activity,m.login_anonymous,m.title,m.hide_email, m.warn_level, m.warn_lastwarn,
me.msnname,me.aim_name,me.icq_number,me.signature, me.website,me.yahoo,me.location,
me.avatar_location, me.avatar_type, me.avatar_size, pc.* FROM trap17_ipbposts p LEFT
JOIN tr....
Strange Error On My Site
(2) i was getting a too many connections error when i attempted to acess my site. why was it doing this?....
Looking for php, fopen, error, prob, permissions, php, fopen
|
|
Searching Video's for php, fopen, error, prob, permissions, php, fopen
|
advertisement
|
|