Problems configuring symfony 2.7 and 3.0 (the problem is the same)

"/ App / cache /" or / "var / cache /" / App app / logs / or or var var / logs / ’

Standard solutions, of course, tried from the documentation Symfony, head of Checking Symfony Application Configuration and Setup .

Setting up Permissions:

Yuri@localhost /v/w/symfony.loc> sudo rm -rf var/cache/* Yuri@localhost /v/w/symfony.loc> sudo rm -rf var/logs/* Yuri@localhost /v/w/symfony.loc> sudo setfacl -R -mu:apache:rwX -mu:Yuri:rwX var/cache var/logs Yuri@localhost /v/w/symfony.loc> sudo setfacl -dR -mu:apache:rwX -mu:Yuri:rwX var/cache var/logs Yuri@localhost /v/w/symfony.loc> sudo service httpd restart Redirecting to /bin/systemctl restart httpd.service 

The group at the web server is exactly apache. Proof

 Yuri@localhost /v/w/symfony.loc> ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1 apache Yuri@localhost /v/w/symfony.loc> 

I also used an extreme solution from the chapter Setting up Permissions : substituted the beginning of the files: (bin / console, web / app.php and web / app_dev.php) -> umask (0000) to the beginning;

 Yuri@localhost /v/w/symfony.loc> sudo service httpd restart Redirecting to /bin/systemctl restart httpd.service Yuri@localhost /v/w/symfony.loc> service httpd status Redirecting to /bin/systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: active (running) since Чт 2015-12-24 23:17:13 MSK; 11min ago Main PID: 9196 (httpd) Status: "Total requests: 8; Idle/Busy workers 100/0;Requests/sec: 0.0121; Bytes served/sec: 51 B/sec" CGroup: /system.slice/httpd.service ├─9196 /usr/sbin/httpd -DFOREGROUND ├─9197 /usr/sbin/httpd -DFOREGROUND ├─9198 /usr/sbin/httpd -DFOREGROUND ├─9199 /usr/sbin/httpd -DFOREGROUND ├─9201 /usr/sbin/httpd -DFOREGROUND ├─9205 /usr/sbin/httpd -DFOREGROUND ├─9207 /usr/sbin/httpd -DFOREGROUND └─9354 /usr/sbin/httpd -DFOREGROUND дек 24 23:17:13 localhost.localdomain systemd[1]: Starting The Apache HTTP... дек 24 23:17:13 localhost.localdomain httpd[9196]: AH00548: NameVirtualHos... дек 24 23:17:13 localhost.localdomain systemd[1]: Started The Apache HTTP ... Hint: Some lines were ellipsized, use -l to show in full. Yuri@localhost /v/w/symfony.loc> 

Nginx and php-fpm is not exactly included

 Yuri@localhost /v/w/symfony.loc> sudo service php-fpm status [sudo] пароль для Yuri: Redirecting to /bin/systemctl status php-fpm.service ● php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled) Active: inactive (dead) Yuri@localhost /v/w/symfony.loc> sudo service nginx status Redirecting to /bin/systemctl status nginx.service ● nginx.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead) Yuri@localhost /v/w/symfony.loc> 

In the spaces of Ru & En-neta did not find more solutions: (I repeat, the problem on symfony 2.7 and 3.0 is identical. I tried on fedora 22 php5.6.15 and php7. I tried different combinations of apache owners: Yuri, including creating new files too - nothing helped. :( There are still possible options?

  • It is clear that the problem is that I put all the rights right. But after launching bin / console cache: clear or web / config.php, all rights are overwritten, as they were by default. Umask (0000); I already in console, app_dev, app, config.php put down, as advised in the off manual, they are not overwritten, but do not work either. Already tried and set the framework through the newly created user interface with the primary group apache - the problem is the same. - Yuri Glushenkov
  • Yuri, I, of course, understand that I have little reputation in Russian SO to rule questions without verification. But at least look at the statistics of my edits, my edits on enSO. I never make edits that would not improve the issue. Anchoring is much easier than searching for the necessary section on the page. The symfony3 tag (as well as symfony2) is commonly avoided in the symfony community. Let the community contribute, do not reject edits with contrived "reasons". - Michael Sivolobov
  • Discussion of editing this question on Mete: What to do when editing is unjustly not taken from the author’s voice alone - Nick Volynkin
  • @YuriGlushenkov, and did the composer update ? Check run from the console or through config.php ? - Michael Sivolobov
  • @MichaelSivolobov: composer update did. Through the console, everything is ok, via config.php (also umask(0000); just in case, as advised in the off-manual for app_dev.php ets did not help), I check. I thought to score on config.php and continue working, but already an error about what is not possible to read from var/cache/dev/ (previously the dev directory in the default state was restored after rm -rf var/cache/* ). - Yuri Glushenkov

2 answers 2

If anyone is interested, then the problem was in SELinux . vi /etc/selinux/config or nano /etc/selinux/config And restart the computer sudo reboot

    I was not steamed and added an alias to the composer that runs from www-data sudo www-data -c 'composer app / console' like that.