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

Permission denied?

P: n/a
I am trying to make a new file using fopen, but I got a exception:
failed to open stream: Permission denied in tmp/ ..

I am using linux and I've already chmod the php file to 777.

I tried adding exec("touch afile") in my php program and the result is
there is no exception but no file come out.

I am confused? how to control the permission in PHP?
Thanks a lot

fAnS.

Oct 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
fAnSKyer wrote:
I am trying to make a new file using fopen, but I got a exception:
failed to open stream: Permission denied in tmp/ ..

I am using linux and I've already chmod the php file to 777.

I tried adding exec("touch afile") in my php program and the result is
there is no exception but no file come out.

I am confused? how to control the permission in PHP?
Thanks a lot

fAnS.
Do you have permission to create files in tmp/? If this is being done
on a web page, that would be the userid the webserver is running under.

What's the actual fopen() you are using?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 17 '06 #2

P: n/a
fAnSKyer wrote:
I am trying to make a new file using fopen, but I got a exception:
failed to open stream: Permission denied in tmp/ ..

I am using linux and I've already chmod the php file to 777.

I tried adding exec("touch afile") in my php program and the result is
there is no exception but no file come out.

I am confused? how to control the permission in PHP?
Thanks a lot

fAnS.
did you use chmod 777 on tmp dir by ftp or php ?
Oct 17 '06 #3

P: n/a
thanks a lot
it is because the permission for the tmp

Sorry for such a stupid question :)

Cheers
FanS.
Gale wrote:
fAnSKyer wrote:
I am trying to make a new file using fopen, but I got a exception:
failed to open stream: Permission denied in tmp/ ..

I am using linux and I've already chmod the php file to 777.

I tried adding exec("touch afile") in my php program and the result is
there is no exception but no file come out.

I am confused? how to control the permission in PHP?
Thanks a lot

fAnS.

did you use chmod 777 on tmp dir by ftp or php ?
Oct 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.