Old 25-05-2004, 05:07   #1 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,211
? what does this mean?

Warning: fopen(content1.php): failed to open stream: Permission denied in /home/...

Warning: fwrite(): supplied argument is not a valid stream resource in /home/...

Warning: fclose(): supplied argument is not a valid stream resource in /home/...

works on some servers and not on others.

ta.
  Reply With Quote
Old 25-05-2004, 05:18   #2 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,874
It's stating that an attempt to open the file content1.php and write to it has failed.
For this to work the directory housing the file ('home') has to have suitable permissions available.
You can set the permissions of a directory via your control panel or you ftp client.

As the php/app is failing to initially open the file, the second (write) and third (close) tasks cannot be executed either, so both kick up errors.

The inconsistency will probably be down to permissions being set on some servers/directories, but not on others.

blah, blah:
http://www.htmlite.com/php042.php
http://uk2.php.net/fopen
  Reply With Quote
Old 25-05-2004, 05:37   #3 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,211
Quote:
Originally Posted by Bill Posters
You can set the permissions of a directory via your control panel or you ftp client.
already checked all that they match. cheers for thelinks. will continue to search
  Reply With Quote
Old 25-05-2004, 05:42   #4 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,211
ok, summat kooky going on, changed chmod to 777 and all works fine but on other server was set at 644 but still worked.

is it dangerous to set stuff at 777 (ie, all can read and write and execeute?)
  Reply With Quote
Old 25-05-2004, 05:46   #5 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,625
You tried 755?
  Reply With Quote
Old 25-05-2004, 05:51   #6 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,211
yep, it didn't work. confusing me. its only a crude development cms (so client can enter a wish list of content on a page whilst we're developing it) so not likely to be on the live site - kinda annoying though.
  Reply With Quote
Old 30-06-2004, 07:29   #7 (permalink)
DaiWelsh
Registered User
 
Join Date: Mar 2004
Location: Derby, UK
Posts: 24
It depends what user the website is run under compared to the user you ftp as.

If you ftp as your username and the webserver also runs your site as your username then 644 will work as the webserver is running as your user and hence is the owner of the file and the '6' part (Read & Write) applies to them.

If you ftp as your username and the webserver runs your site as anon or something similar then 644 will not work as the webserver is running as a different user and hence is NOT the owner of the file and the '4' part (Read only) applies to them.

777 will always work as you are basically saying that all users can write to the file so even if the webserver runs your script as anon it can still write.

Different ISPs use different configurations for what user the webserve runs as, e.g. see
http://httpd.apache.org/docs-2.0/suexec.html . If you want to find out, one way (doubtless there are others) is to upload a file and see who the owner is (tells you what user you ftp as) then write a simple php script to create a file, run it via webserver and see who owns that file (tells you what user web server runs as).

HTH,

Dai
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8