469,362 Members | 2,548 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

Permission denied with rename() funcion

i am trying to rename a file using PHP
i have the script as per below

rename("/home/user/public_html/test.htm",
/home/user/public_html/testOLD.htm");

when i run it i get an error Permission denied in the browser - why is this
??

Thanks in advance

Jul 17 '05 #1
7 16632
"chris" <so*****@here.com> wrote in message
news:3f********@funnel.arach.net.au...
i am trying to rename a file using PHP
i have the script as per below

rename("/home/user/public_html/test.htm",
/home/user/public_html/testOLD.htm");

when i run it i get an error Permission denied in the browser - why is this ??

Thanks in advance


Using FTP, CHMOD the file to 777.

--
Sharif Tanvir Karim
http://www.onlyonxbox.net
Jul 17 '05 #2

"Sharif Tanvir Karim" <sh****@nyc.rr.com> wrote in message
news:eq********************@twister.nyc.rr.com...
"chris" <so*****@here.com> wrote in message
news:3f********@funnel.arach.net.au...
i am trying to rename a file using PHP
i have the script as per below

rename("/home/user/public_html/test.htm",
/home/user/public_html/testOLD.htm");

when i run it i get an error Permission denied in the browser - why is this
??

Thanks in advance


Using FTP, CHMOD the file to 777.


is there a way in php to chmod??
--
Sharif Tanvir Karim
http://www.onlyonxbox.net


Jul 17 '05 #3

i have tried chmod() function in PHP

NOW i get an error
Operation not permitted

"Sharif Tanvir Karim" <sh****@nyc.rr.com> wrote in message
news:eq********************@twister.nyc.rr.com...
"chris" <so*****@here.com> wrote in message
news:3f********@funnel.arach.net.au...
i am trying to rename a file using PHP
i have the script as per below

rename("/home/user/public_html/test.htm",
/home/user/public_html/testOLD.htm");

when i run it i get an error Permission denied in the browser - why is

this
??

Thanks in advance


Using FTP, CHMOD the file to 777.

--
Sharif Tanvir Karim
http://www.onlyonxbox.net

Jul 17 '05 #4
chris wrote:
"Sharif Tanvir Karim" <sh****@nyc.rr.com> wrote in message
news:eq********************@twister.nyc.rr.com...

Using FTP, CHMOD the file to 777.

is there a way in php to chmod??


Yes, but php must be the owner of the file. In this case php won't be
the owner so it won't work, you'll just get another similar error
message. You need to use ftp to make this change.

Jul 17 '05 #5
"kicken" <sl***@aoeex.com> wrote in message
news:pXOvb.205026$mZ5.1533427@attbi_s54...
chris wrote:
"Sharif Tanvir Karim" <sh****@nyc.rr.com> wrote in message
news:eq********************@twister.nyc.rr.com...

Using FTP, CHMOD the file to 777.

is there a way in php to chmod??


Yes, but php must be the owner of the file. In this case php won't be
the owner so it won't work, you'll just get another similar error
message. You need to use ftp to make this change.


how can i MAKE php the owner of the file - is this possible??

i have full server access BTW
Jul 17 '05 #6
chris wrote:

how can i MAKE php the owner of the file - is this possible??

i have full server access BTW


I think (but im not sure about that) you have to set the group/owner to
apache (if you are using an apache), more detailed: You have to set the
group and/or owner rights to your http-server, because this is the
service that accesses the file.
Certainly your files have the rights of your user account, but your
Web-Server is another "user" in another group.

Hope this helped,

Greetings, Till.

Jul 17 '05 #7


"chris" <so*****@here.com> wrote in message
news:3f********@funnel.arach.net.au...

i have tried chmod() function in PHP

NOW i get an error
Operation not permitted

"Sharif Tanvir Karim" <sh****@nyc.rr.com> wrote in message
news:eq********************@twister.nyc.rr.com...
"chris" <so*****@here.com> wrote in message
news:3f********@funnel.arach.net.au...
i am trying to rename a file using PHP
i have the script as per below

rename("/home/user/public_html/test.htm",
/home/user/public_html/testOLD.htm");

when i run it i get an error Permission denied in the browser - why is

this
??

Thanks in advance


Using FTP, CHMOD the file to 777.

--
Sharif Tanvir Karim
http://www.onlyonxbox.net


Chris,

CHMOD the file through an FTP program.
--
Sharif Tanvir Karim
http://www.onlyonxbox.net
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by JaazzMan | last post: by
7 posts views Thread by Stéphane Ninin | last post: by
2 posts views Thread by Taishi | last post: by
reply views Thread by private.anders | last post: by
reply views Thread by private.anders | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.