fopen function
Moderator: General Moderators
fopen function
Hi folks,
I'm trying to write a script that creates files as seen in this tutorial here:
http://www.vipercreations.com/tutorials ... 5&act=view
I keep getting
Warning: fopen(home/molin3/public_html/htm/HTPA2A153.htm) [function.fopen]: failed to open stream: No such file or directory in /home/molin3/public_html/htm/addfile.php
The directory I'm using is /home/molin3/public_html/htm/
Am I putting in the wrong path or is it possibly that the fopen function is disabled on my server. If so, How can I check and/or enable it?
I'm trying to write a script that creates files as seen in this tutorial here:
http://www.vipercreations.com/tutorials ... 5&act=view
I keep getting
Warning: fopen(home/molin3/public_html/htm/HTPA2A153.htm) [function.fopen]: failed to open stream: No such file or directory in /home/molin3/public_html/htm/addfile.php
The directory I'm using is /home/molin3/public_html/htm/
Am I putting in the wrong path or is it possibly that the fopen function is disabled on my server. If so, How can I check and/or enable it?
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
the public_html directory is set to 750. When I tried to change it, some problems were created where php was unable to read from the mysql database. I had to contact my webhost to get it restored, and I don't know what they did.Everah wrote:Permission denied usually means that means your web server doesn't have permission to view/open that file. What are the permissions on that directory/file?
I created a subdirectory called "htm" and gave it permissions of 777, but I'm not sure if that's overriden by the public_html directory which is above it.
Anyways, I thought the chmod function in this script was supposed to adjust to the appropriate permissions.
But there is a CHMOD in the script. Could you please take a look at the script in the link above and tell me if the CHMOD part is written correctly or needs adjustment?feyd wrote:That error is due to the fact that PHP has not been given permission to read and/or write to the directory or file in question. CHMOD time.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
When I created the directory "htm" and gave it the 777 permissions, is this what you mean?Everah wrote:You don't want to chmod permissions on public_html, you want to do it on the directory that needs to be accessed and on that directory only. You typically do not do this programmatically, but through either the CLI with a chmod command or through an FTP client of some sort.
Are you saying running the same script using a CLI will work?
Ok, I'm gonna try it with CLI.
I've never worked on CLI before. Do you recommend any package for installing it for windows?
How's ezpublish?
http://ez.no/ezpublish/documentation/in ... ge_php_cli
I've never worked on CLI before. Do you recommend any package for installing it for windows?
How's ezpublish?
http://ez.no/ezpublish/documentation/in ... ge_php_cli
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA