为什么 sylius 在 dev 的本地运行如此缓慢? [英] Why is sylius running so slow on local in dev?

查看:27
本文介绍了为什么 sylius 在 dev 的本地运行如此缓慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 sylius 的安装说明进行了 Composer 操作,并让我的本地副本正常工作.问题是当我转到 local/app_dev.php 时,加载需要很长时间,12-18 秒.但是分析器显示的时间要快得多...

I followed sylius' install instructions for composer and got my local copy working. The issue is when I go to local/app_dev.php it takes an extremely long time to load, 12-18 seconds. however the profiler is showing a much faster time...

此外,安装说明也没有解释如何让 local/app.php 工作或生产环境.任何信息都会有帮助:)

Also the installation instructions don't explain how to get local/app.php working or a production environment. Any information would be helpful :).

推荐答案

首先让我感谢@Florian 提供的链接和让我深入挖掘的推动力 :).

First let me thank @Florian for his link and the nudge to get me digging a little :).

按照sylius 入门页面上的说明进行操作时:

When following the instructions on sylius' getting started page:

$ wget http://getcomposer.org/composer.phar
$ composer.phar create-project sylius/sylius -s dev
$ cd sylius
$ app/console sylius:install

默认情况下,您使用 config_dev.yml 文件进行安装.这会将您的数据库设置为 {dbname}_dev,并在 app_dev.php 中进行调试.当调试处于 "缓存文件在每个请求上动态重建." 这就是导致速度慢的原因.

you are by default installing using the config_dev.yml file. This will setup your db as {dbname}_dev, as well as have debug on in app_dev.php. When debug is on "cache files are dynamically rebuilt on each request." This is what is causing the slow speed.

关于使用 app.php(production env) 你可以运行 app/console sylius:install -e prod.这将设置一个常规数据库,您可以使用 app.php.

In regards to using app.php(production env) you can run app/console sylius:install -e prod. This will setup a regular db and you can use app.php.

谜团解开:)

有用的资源:如何掌握和创建新环境 - Symfony2

这篇关于为什么 sylius 在 dev 的本地运行如此缓慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆