Symfony 2: dev to pro = blank page

First I asked you to excuse my English. I made a site with Symfony that works great locally. (dev and prod). But as soon as I install online, the dev version works, but the prod version displays a blank page. Lighttpd does not give me an error. PHP does not give me an error. Cache and journal are writable.

I do not understand anything.

+6
source share
4 answers

OK, this is a very undesirable situation, since you need to glue errors every time. It can be as soft as the missing php module or some basic httpd wrong configuration.

Some steps that should shed light on a problem:

  • Launch Terminal (you have ssh access, right?)
  • Check logs (both httpd and symfony )

httpd log:

 tail -f /var/log/httpd/error_log 

... and refresh the page

Symfony

 tail -f /path-to-your-symfony-app/app/logs/prod.log 

... again, refresh the page

In your comment, you said that you encountered an HTTP500 error. Is it Apache or Symfony HTTP500 ?

If you are not using ssh access, download app_dev.php and run it directly. Do not forget to add your IP address to the allowed list (inside the file)

+2
source

Change your permission to cache and log folders in 777 .

 chmod 777 cache/ log/ -R php symfony cc 
+1
source

As the documentation reports:

Instead of a welcome page, you may see a blank page or an error page. This is caused by an incorrect directory resolution configuration. There are several possible solutions, depending on your operating system. All of them are described in the "Setting Permissions" section.

And then you should follow these steps :

  • rm -rf app/cache/*
  • rm -rf app/logs/*
  • HTTPDUSER=' ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1'
  • sudo setfacl -R -mu:"$HTTPDUSER":rwX -mu:'whoami':rwX app/cache app/logs
  • sudo setfacl -dR -mu:"$HTTPDUSER":rwX -mu:'whoami':rwX app/cache app/logs
+1
source

I did the deployment, guided by official docs

In my case, updating symfony before deployment did not have BC with the old Bundle, so clear: cache --env = prod threw some error. So I did this to manually delete the prod cache, and then clear: the cache with the working environment, and it worked: so to resume:

 #rm -rf app/cache/prod/* #removes only production cache rm -rf app/cache/ #removes prod and any other stage cache php app/console cache:clear --env=prod 
0
source

All Articles