开发者

Symfony2 gives blank page

开发者 https://www.devze.com 2023-03-25 06:17 出处:网络
Symfony 2 dies and gives me blank page. Disclaimer: I hate blank pages. Anyway, how do I find out what went wrong; why it died; why there\'s no error?

Symfony 2 dies and gives me blank page. Disclaimer: I hate blank pages. Anyway, how do I find out what went wrong; why it died; why there's no error?

Checking the dev.log it gives me useless info:

[2011-08-05 08:41:33] doctrine.DEBUG: UPDATE accTransactions SET report_id = ? WHERE id = ? ([8163,2941852])
[2011-08-05 08:41:33] event.DEBUG: Notified event "kernel.view" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelView".
[2011-08-05 08:41:33] event.DEBUG: Listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelView" stopped propagation of the event "kernel.view".
[2011-08-05 08:41:33] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse".
[2011-08-05 08:41:33] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\SecurityBundle\EventListener\ResponseListener::onKernelResponse".
[2011-08-05 08:41:33] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bridge\Monolog\Handler\FirePHPHandler::onKernelResponse".
[2011-08-05 08:41:33] event.DEBUG: Notified event "kernel.response" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener::onKernelResponse".
[2011-08-05 08:41:33] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse".
[2011-08-05 08:41:35] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener::onKernelResponse".

The php_error.log and other do not have an error.

I'm running an update on a large table, and doing about 1500+ queries per request (taking about 15sec). I assume the death of PHP has something to do with Doctrine2 then. It's very unstable, in that it start to die when the number of transactions seems to increase... I have to admin I expected much more from an ORM, not just blank deaths.

Is there a db log file or something that can give me an error? Anything to work with besides doing 1 transaction at a time, because that'll take 13,333 hours... It's a very basic update (just adding that one relation) if you look 开发者_如何转开发at the first log entry.

I'm running PHP 5.3.2 with APC

I've also noticed that when the function gets to the flush command at the bottom, it successfully executes it. Thus, I assume it's only SF2 now that does not render the view successfully?


If you are batch processing in Doctrine2 then your entity manager will be growing and you are breaching you PHP memory limit.

http://www.doctrine-project.org/blog/doctrine2-batch-processing.html

You are creating thousands of objects and this is growing with each cycle.

You need to be careful when batch processing with an ORM that you eliminate memory leaks. An ORM is not always the best tool for this job but it CAN be used if you are careful with what you are doing.


try to delete these folders : - cache - logs

and reload your page.


I think you should turn on and look at your MySQL query log. On Debian Linux you should edit file /etc/mysql/my.cnf and edit it so it should have a look something similar to

[mysqld]
# ...

# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
general_log_file        = /var/log/mysql/mysql.log
general_log             = 1
log_error                = /var/log/mysql/error.log

So you'll be able to view it realtime by tail -F /var/log/mysql/mysql.log


Try to add "cache: false" to twig in your config file for your environment. Solve me.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号