shane07 Posted September 14, 2011 Share Posted September 14, 2011 I have a weird kind of problem. I uploaded all upload-directories through FTP which have 777 permissions and owner name 'abc' This means I can access all of them through the codes. But while creating files inside those full permitted directories, the compiler complains for access denied. Meanwhile, a different directory is created with same name whose owner is 'apache' itself and the previous directory is lost. Then I cannot change the permissions of that directory through FTP. I don't if it is apache server's problem itself or not. Or is it a way to define user while creating/editing/deleting files and directories through php code itself? Quote Link to comment Share on other sites More sharing options...
trq Posted September 14, 2011 Share Posted September 14, 2011 PHP operates as part of Apache. Apache runs as a specific user, it is this user that needs permission to create files/directories using PHP. Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted September 14, 2011 Share Posted September 14, 2011 you can either change the permissions of www-data manually, through PHP using chmode or terminal Quote Link to comment Share on other sites More sharing options...
shane07 Posted September 14, 2011 Author Share Posted September 14, 2011 this means I need to change the owner to 'apache' using chown before doing something, isn't it? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted September 14, 2011 Share Posted September 14, 2011 the owner will be "www-data" which is the owner that apache uses Quote Link to comment Share on other sites More sharing options...
trq Posted September 14, 2011 Share Posted September 14, 2011 the owner will be "www-data" which is the owner that apache uses This completely depends upon Apache's configuration. You can check who apache runs as by executing: grep User /etc/apache2/httpd.conf The path to your config file might also be different though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.