Symfony on Xampp is very slow in development, what

2019-03-13 00:00发布

I have set up Symfony but every page load requires 40 seconds.

If I have an empty controller it takes 8 seconds to load. If I start to make some complex queries on the database, it's worse. What can I do?

  • deactivate the profiler? (will this change a lot?)
  • activate APC on dev mode? (but will this not be a problem for changing the code)
  • put the session inside APC?
  • put Doctrine in the garbage?
  • .... ?

I don't really know where to start.

(I am using Windows 7 with Xampp server and 8gb of ram)

2条回答
Juvenile、少年°
2楼-- · 2019-03-13 00:36

A few quick suggestions:

  • install PHP 5.5.x (faster)
  • Use mod_fcgid instead of mod_php with Apache
  • Raise realpath_cache_size and realpath_cache_ttl in your php.ini
  • disable XDebug
  • ...

See this question, this question and this question.

查看更多
手持菜刀,她持情操
3楼-- · 2019-03-13 00:39

Something is not right on your system. 40 seconds is way too long. Even in dev mode, your pages should be showing within a second or two.

Someone else has had similar problems here: Windows 7 php + Symfony2 terribly slow

查看更多
登录 后发表回答