|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
So, I'm trying to write a PHP script to open a text file and edit it. I've made all the permissions 777, and I still get:
Warning: fopen() [function.fopen]: failed to open stream: Permission denied in [directory] on line 3 I can't seem to figure out why this isn't working. Any suggestions would be appreciated. |
| Sponsored Links |
|
|
|
|||||
|
Could you post your fopen() code and the file path/variable?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||
|
The code is very simple:
Code:
<?php
echo getcwd();
$fp = fopen("tuesdayR.txt", "w+");
fclose($fp);
?>
E:\users\orchestra\Rehearsals Warning: fopen(tuesdayR.txt) [function.fopen]: failed to open stream: Permission denied in E:\users\orchestra\Rehearsals\testPHP.php on line 3 Warning: fclose(): supplied argument is not a valid stream resource in E:\users\orchestra\Rehearsals\testPHP.php on line 4 PHP Warning: fopen(tuesdayR.txt) [function.fopen]: failed to open stream: Permission denied in E:\users\orchestra\Rehearsals\testPHP.php on line 3 PHP Warning: fclose(): supplied argument is not a valid stream resource in E:\users\orchestra\Rehearsals\testPHP.php on line 4 Last edited by FlyByWire128; 07-24-2007 at 08:21 AM. Reason: Forgot something... |
|
|||
|
I tried adding the whole path as suggested, but no luck. It's still telling me permission denied, and I can't figure out why... Every suggestion I've ever heard when this happens is to change the permissions, but they're all set, so that shouldn't be a problem. Any other suggestions?
|
|
|||||
|
Have you tried a different file? Maybe it isn't the file permissions but the directory permissions. I've ran into this on Windows Machines before.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||
|
I've tried different files, I've tried different directories, I've tried files that already exist, I've tried creating a new file using fopen(). I'm using SmartFTP, and according to it, the directory, and the files are all 777 permissions... I don't know what else to do.
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP 4 end of life announcement | Jordan | Programming News | 4 | 08-30-2007 10:55 AM |
| PHP Introduction | clookid | PHP Tutorials | 10 | 01-16-2007 08:17 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%