Permissions for Symfony on Centos vm

Good evening. I thought I would never have to ask this question ... but I have no idea where to look for more.

Here's the problem.

I have installed Symfony on a new Centos 7 vm running in hyper v.

My apache user is apache. My app / cache and apps / logs directory are owned by apache user and apache group. I even set the permissions of these two folders and subfolders to 777.

But still Symfony cannot write to cache and logs.

How is this possible? I would like to have some directions with this problem.

thank

+3


source to share


5 answers


This is not a solution, but a more workaround. I replaced centos vm with ubuntu and now everything works smoothly just by ensuring that the folders are owned by the apache user. This is really a mystery to me. And I realize that I have never applied symfony application on centos before. I'm sure there should be an explanation, but obviously not easy to find.



Thanks everyone for your help.

0


source


Try disabling selinux: [ https://www.centos.org/docs/5/html/5.1/Deployment_Guide/sec-sel-enable-disable.html [1 ] . This solves my problem.

1- Open / etc / sysconfig / selinux and change SELINUX value from permissive (or forced) to disabled



# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=permissive
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0

      

2 Restart your computer and check.

+1


source


On CentOS, you have to log in as root and write this:

sudo chcon -t httpd_sys_rw_content_t .../cache -R
sudo chcon -t httpd_sys_rw_content_t .../logs -R

      

+1


source


For me, this is the best way to configure permissions:

http://symfony.es/documentacion/como-solucionar-el-problema-de-los-permisos-de-symfony2/

Always work for me.

The link is in Spanish, but I'm sure you can understand it by watching the commands (if not speaking Spanish).

0


source


See the section "Setting Permissions" at http://symfony.com/doc/current/book/installation.html

-1


source







All Articles