By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,732 Members | 1,461 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,732 IT Pros & Developers. It's quick & easy.

[PHP] failed to open stream: Permission denied

P: n/a
Hi,

I'd like to upload an image to a folder, then I have 3
diffrents examples but all of them give an error
"failed to open stream: Permission denied", althrough the
C:\Inetpub\wwwroot is not protected.

Any suggestions would be helpful, thank you for your time.
example_1 :

Warning: file_put_contents(31_picture.gif) [function.file-put-contents]:

failed to open stream: Permission denied in C:\Inetpub\wwwroot\AS\index.php

on line 46

example_2 :

Warning: move_uploaded_file

(C:\Inetpub\wwwroot/1c0c4541273310f11decbc7575daf1d8.bin) [function.move-

uploaded-file]: failed to open stream: Permission denied in

C:\Inetpub\wwwroot\file_api.php on line 58

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move

'C:\WINNT\TEMP\php198.tmp' to

'C:\Inetpub\wwwroot/1c0c4541273310f11decbc7575daf1d8.bin' in

C:\Inetpub\wwwroot\file_api.php on line 58

example_3 :

Warning: move_uploaded_file(./web/student_img/5054.jpg) [function.move-

uploaded-file]: failed to open stream: No such file or directory in

C:\Inetpub\wwwroot\web\editaccount.php on line 175

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move

'C:\WINNT\TEMP\php19C.tmp' to './web/student_img/5054.jpg' in

C:\Inetpub\wwwroot\web\editaccount.php on line 175


Nov 15 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a

"Andy2500" <do*************@yahoo.comwrote in message
news:47**********@news.bluewin.ch...
Hi,

I'd like to upload an image to a folder, then I have 3
diffrents examples but all of them give an error
"failed to open stream: Permission denied", althrough the
C:\Inetpub\wwwroot is not protected.
oddly enough, it is a permissions issue. this is running iis, correct? does
c:/inetpub/wwwroot allow read *and* write permission for IUSR_<server name
here>?
Nov 15 '07 #2

P: n/a
On Nov 15, 3:28 pm, "Andy2500" <do_not_use_t...@yahoo.comwrote:
Hi,

I'd like to upload an image to a folder, then I have 3
diffrents examples but all of them give an error
"failed to open stream: Permission denied", althrough the
C:\Inetpub\wwwroot is not protected.

Any suggestions would be helpful, thank you for your time.

example_1 :

Warning: file_put_contents(31_picture.gif) [function.file-put-contents]:

failed to open stream: Permission denied in C:\Inetpub\wwwroot\AS\index.php

on line 46

example_2 :

Warning: move_uploaded_file

(C:\Inetpub\wwwroot/1c0c4541273310f11decbc7575daf1d8.bin) [function.move-

uploaded-file]: failed to open stream: Permission denied in

C:\Inetpub\wwwroot\file_api.php on line 58

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move

'C:\WINNT\TEMP\php198.tmp' to

'C:\Inetpub\wwwroot/1c0c4541273310f11decbc7575daf1d8.bin' in

C:\Inetpub\wwwroot\file_api.php on line 58

example_3 :

Warning: move_uploaded_file(./web/student_img/5054.jpg) [function.move-

uploaded-file]: failed to open stream: No such file or directory in

C:\Inetpub\wwwroot\web\editaccount.php on line 175

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move

'C:\WINNT\TEMP\php19C.tmp' to './web/student_img/5054.jpg' in

C:\Inetpub\wwwroot\web\editaccount.php on line 175
Maybe you should try switching to Linux. Windows is not really a bless
for programming, you know.
I don't know this answer, but if you were on Linux, 1. I would know 2.
You wouldn't need it.

Cheers
Nov 15 '07 #3

P: n/a

"Darko" <da**************@gmail.comwrote in message
news:29**********************************@41g2000h sh.googlegroups.com...
On Nov 15, 3:28 pm, "Andy2500" <do_not_use_t...@yahoo.comwrote:
Maybe you should try switching to Linux. Windows is not really a bless
for programming, you know.
I don't know this answer, but if you were on Linux, 1. I would know 2.
You wouldn't need it.
so, because *you* know linux, the op won't have permissions issues? that
would be entirely false. *i* know windows *and* that fact doesn't help the
op in the least...unless i offer to share what i know.

either way, windows programming is just as easily done as linux programming.
the only main difference would be what libraries you're utilizing. and, as
far as that goes, mfc is hard to beat. let me tell you, borland on windows
ain't much different from borland on linux. :) for that matter, .net
development on either os isn't much different either.

cheers
Nov 15 '07 #4

P: n/a

"Steve" <no****@example.comwrote in message
news:5w*************@newsfe06.lga...
>
>>
I'd like to upload an image to a folder, then I have 3
diffrents examples but all of them give an error
"failed to open stream: Permission denied", althrough the
C:\Inetpub\wwwroot is not protected.

oddly enough, it is a permissions issue. this is running iis, correct?
does c:/inetpub/wwwroot allow read *and* write permission for IUSR_<server
name here>?
Thank you for your reply.
>this is running iis, correct?
Yes, with WinXP SP2 & IIS 5.1
c:/inetpub/wwwroot allow read *and* write permission for IUSR_<server name
here>?
yes it is. It allows read & write permission for IUSR_<server_name>
what should I have to check more ?
Thank you
Nov 15 '07 #5

P: n/a

"Andy2500" <do*************@yahoo.comwrote in message
news:47**********@news.bluewin.ch...
>
"Steve" <no****@example.comwrote in message
news:5w*************@newsfe06.lga...
>>
>>>
I'd like to upload an image to a folder, then I have 3
diffrents examples but all of them give an error
"failed to open stream: Permission denied", althrough the
C:\Inetpub\wwwroot is not protected.

oddly enough, it is a permissions issue. this is running iis, correct?
does c:/inetpub/wwwroot allow read *and* write permission for
IUSR_<server name here>?

Thank you for your reply.
not a problem.
>>this is running iis, correct?
Yes, with WinXP SP2 & IIS 5.1
xp professional i presume...unless you hacked iis support in a lesser
version.
>c:/inetpub/wwwroot allow read *and* write permission for IUSR_<server
name here>?
yes it is. It allows read & write permission for IUSR_<server_name>
so php is running fine, indicating that php initiated by a web hit does in
fact have permissions to read/parse .php files. ok, see if you can make a
simple script that fopen's a new file with write access, then fputs 'hello
world' to it. the important thing to try would be the path. instead of
backslashing the path, use forward slashes:

c:/inetpub/wwwroot/test.txt

post the errors back here please. if there are none, we'll need to look at a
couple of other things more closely.

>what should I have to check more ?

Thank you
not a problem.
Nov 15 '07 #6

P: n/a
On Nov 15, 11:18 am, "Steve" <no....@example.comwrote:
"Darko" <darko.maksimo...@gmail.comwrote in message

news:29**********************************@41g2000h sh.googlegroups.com...
On Nov 15, 3:28 pm, "Andy2500" <do_not_use_t...@yahoo.comwrote:
Maybe you should try switching to Linux. Windows is not really a bless
for programming, you know.
I don't know this answer, but if you were on Linux, 1. I would know 2.
You wouldn't need it.

so, because *you* know linux, the op won't have permissions issues? that
would be entirely false. *i* know windows *and* that fact doesn't help the
op in the least...unless i offer to share what i know.

either way, windows programming is just as easily done as linux programming.
the only main difference would be what libraries you're utilizing. and, as
far as that goes, mfc is hard to beat. let me tell you, borland on windows
ain't much different from borland on linux. :) for that matter, .net
development on either os isn't much different either.

cheers
**&&>>^^, %%$$__((*, @@!->OT, OT = HERE_01

.... just testing various start of off topic markers ...

carry on gentlemen...
Nov 16 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.