6

first I took you to excuse my English. I made a website with Symfony which works fine locally. (dev and prod). But as soon as I put online the dev version works but the prod version displays a blank page. Lighttpd does not give me error. PHP does not give me error. Cache and log are writable.

I do not understand anything.

6
  • Can you check HTTP response (in Chrome Developer Toolbar) when you get a blank page? Commented Mar 26, 2014 at 22:43
  • 1
    Seems like you just have to clear your cache php app/console cache:clear --env=prod or just remove everything manually in the app/cache/ folder. Commented Mar 26, 2014 at 22:51
  • 500 Internal Server Error T_T Commented Mar 26, 2014 at 23:04
  • Seems like you just have to clear your cache php app/console cache:clear --env=prod or just remove everything manually in the app/cache/ folder -> nothing change Commented Mar 26, 2014 at 23:09
  • Does your web server have permissions to write to the cache folders on the production server? symfony.com/doc/current/book/… Commented Mar 27, 2014 at 4:33

4 Answers 4

2

OK, this is highly undesirable situation as you need to squash bugs one-by-one. It could be as benign as missing php module or some major httpd misconfiguraion.

Some steps that should shed some light on the issue:

  1. Fire up the Terminal (you do have ssh access, right?)
  2. Check logs (both httpd and symfony)

httpd log:

tail -f /var/log/httpd/error_log

... and refresh your page

Symfony

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

... again, refresh your page

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

If you do not hape ssh access upload your app_dev.php and run it directly. Be sure to add your IP address to list of allowed (within the file)

Sign up to request clarification or add additional context in comments.

3 Comments

I use ssh access. I looked at the log file lighttpd and nothing changes when I reload the page. I do not have a dev.log but just a prod.log for symfony.
And how about access_log of your lighttpd? Sorry, I'm a bit unfamiliar about log names in lighttp...
My log in prod : log file and my log in dev : log file
1

Change your permission on cache and log folders in 777.

chmod 777 cache/ log/ -R
php symfony cc

1 Comment

It was just chmodding app/cache/ and app/logs/ for me
1

As the documentation says:

Instead of the Welcome Page, you may see a blank page or an error page. This is caused by a directory permission misconfiguration. There are several possible solutions depending on your operating system. All of them are explained in the Setting up Permissions section.

And then you should follow these steps:

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

Comments

0

I did the deployment as guided in this official docs

In my case the update of symfony before deploying was not BC with an old Bundle, so the clear:cache --env=prod was giving some error. So what I did was to manually delete the prod cache and then clear:cache with the prod 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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.