PHP Permissions

asked Nov 26, 2013 in Shared Hosting by Giantweb (220 points)
Hi there,
I have a CentOS server hosting a number of websites. I setup the Apache with virtual host configuration and userdir but I am having some problems with the permissions. Some of my php applications and one of my websites are not working right because of permission issues. They don’t have the required permission to write into files and directories. It only works right if I set apache as the files owner. How should I setup apache for a multiuser server.
Your help is highly apprecited

3 Answers

0 like 0 dislike
answered Nov 26, 2013 by tareq101 (4,880 points)
Try suPHP to setup  your Apache on your server. suPHP allows  PHP to write as the user and gives the required user permissions.
0 like 0 dislike
answered Nov 26, 2013 by ZakWeb (3,880 points)
You can also use php-fpm  or fastcgi. The permissions should not be owned by apache, it should be owned by your hosting account user. Gove your folders the 755 permissions and your files  644 permission or 755 permission  if they have to execute for.
0 like 0 dislike
answered Nov 26, 2013 by citrix345 (380 points)
FCGI is another option you can use. This has the advantage of being used with php accelerator . this will  make your website load faster.