0
votes

I work on an app in symfony 2 which uses the sonata-admin bundle. I added 6 vars in my entity, and I can edit their value in my back-office to see the result in the front office.

Everything works fine when I go to my website in app_dev.php (and app_dev.php/admin for the back office)

But when I try to access to the website within the app.php, the changes don't show in my front office and I have a 404 error in the back. If I explicite the vars's typos in the $formMapper of the sonata admin's configureFormFields function, I can see my form but it doesn't get back the values already stored in the database.

I must precise I tried all clear cache options possible, with --env, --no-debug, and I tried to delete the app/cache/prod folder, create it again with the permissions. Apache logs do not show anything in particular.

Thank you for your help.

1
What about symfony's logs in app/logs? - Diego Ferri
What @DiegoFerri said. Always, always check the logs :) This filters out most unwanted logging noise: tail -f app/logs/prod.log | grep -v DEBUG. Run that, reload the page. You should get some meaningful information from that. - Darragh Enright
My last significant log message concerns an old error already corrected. I do not have any more log for one hour, even if I refresh the page. Please note that everything works fine, dev or prod on my local computer. - Rubix
Okay, it's not actually clear from your question - but your comment suggests that you have no problem on your local machine in either environment, and you are only experiencing this issue on a production server. Is this accurate? If so, can you verify that the production server is fit for purpose? You can run php app/check.php, and browse to http://yourdomain.com/config.php which might confirm if there is a server-level issue. - Darragh Enright
I checked the domain.com/config.php and I saw the error : the timezone was not defined in my php.ini. I defined it and now everything is OK. Thank you ! - Rubix

1 Answers

1
votes

try to clear cache with

 php bin/console cache:clear --no-warmup --env=prod