I am moving a site to a new server - just a straight copy across. The site is written in PHP. The main core script is causing problems though - it builds a series of static files using a fairly normal fopen command to create or edit files. On the old box - works fine. The new box - gives me the following error (for example): Warning: fopen(../archive/mini_Interviews.txt): failed to open stream: Permission denied in /home/virtual/site10/fst/var/www/html/administ/all.php on line 1759 I have set the server PHP to safe mode off, shows errors. The folder permissions seem OK. As far as I can tell, the new server is now set up identically to the old sever. But obviously something is not right. I wonder if the ownership of the folder/files is an issue - although it never has been before, and I am not totally sure how to fix that if it is the problem. Editing the script to create the files in the same folder as the script itself actually seems to work. I tried referencing the target folder using the full server path - did not work. It would seem then (possibly) that the issue relates to the script sitting in the same folder as the files it is trying to create ? Any clues as to what to look for so I can fix this issue ?
well, it could be that the script doesn't known is relate position compared to the script it want to reach. Are you going to write to this file? If so, it's possible that your script only open it as a buffer format so it cannot be edited (nor opened because it thinks it's a url). That would explain why the file being in the same folder makes it work.
or allow_url_fopen is not enabled, and you're pointing to a url? (I'm not sure since I can't see the full file address in the fopen query)
This problem is there for me to in the godaddy server. any way do you want to open the file in read mode or write mode try with fopen("filename ", "r");
godaddy has restrictions. anyway if you are using fopen with a w glag for writing, make sure the folder (archive) is owned by you (obviously if you're using godaddy) and that you user has a permissions (+w) in there. (chmod it to 777 anyway). But again, I'm sure it's godaddy's side.
You rock! I was having the same problem and spent almost 3 hours looking for clues via Gaagle and found nothing relevant. I spent 5 minutes searching in DP and found your comment - bingo. Thanks!
Yeah - that isn't the problem. It is related the the firewall. So, if my host is blocking fopen - it doesn't matter how many files I modify - it is still blocked at a level I cannot influence.
I have had to change hosts for many of my sites because they disabled fopen & popen. it is a right shit
Dang - that is what I was afraid of. Thanks for letting me know I am not the only one having this PROBLEM! Does this affect people's ability to use the DP Co-op links on their site?
That is a good idea - maybe I will try and contact one of my hosts and see if they can (I mean "will") this. Thanks!