关键点:
和https://test.app/admin
都应明显更快。https://test.app
>
在Vagrant上设置并优化sulu
我们将使用宅基地的改进,但是这些原则广泛适用。>
1。初始设置:
<code class="language-bash">git clone https://github.com/swader/homestead_improved hi_sulu cd hi_sulu; bin/folderfix.sh</code>>将文件共享与NFS设置(建议减轻已知问题)。
Homestead.yaml
(提供的Nginx配置至关重要;根据非霍姆斯特德环境的需要进行适应。)
<code class="language-yaml">- map: test.app to: /home/vagrant/Code/sulu/web type: symfony-sulu</code>
2。 Vagrant和Sulu安装:
启动VM和SSH:
<code class="language-bash">vagrant up; vagrant ssh</code>>安装sulu:
test.app
(地址潜在的PHP版本冲突;必要时使用/etc/hosts
。
<code class="language-bash">cd Code git clone https://github.com/sulu-io/sulu-standard sulu; cd sulu git checkout master composer install</code>
运行构建命令(开发环境):sudo apt-get upgrade php7.0-fpm
<code class="language-bash">cp app/Resources/webspaces/sulu.io.xml.dist app/Resources/webspaces/sulu.io.xml cp app/Resources/pages/default.xml.dist app/Resources/pages/default.xml cp app/Resources/pages/overview.xml.dist app/Resources/pages/overview.xml cp app/Resources/snippets/default.xml.dist app/Resources/snippets/default.xml rm -rf app/cache/* rm -rf app/logs/*</code>
<code class="language-bash">app/console sulu:build dev</code>
<code class="language-bash">app/console assetic:dump</code>
web/admin.php
web/website.php
app/AbstractKernel.php
和getCacheDir
>用于使用dev/test环境的方法。这将日志和缓存移至VM-Local存储。getLogDir
/dev/shm
vendor
或遵循手动步骤。相应地更新您的IDE的路径。/home/vagrant/vendors/sulu-test.app
>启用apc缓存:~/Code/bin/sulu/vendorfix.sh
web/website.php
其他优化:web/admin.php
增加realpath_cache_size
>
realpath_cache_ttl
/etc/php/7.0/fpm/php.ini
sudo phpdismod xdebug; sudo service php7.0-fpm restart
4。故障排除:
解决常见问题,例如陈旧缓存,不正确的类位置(使用,,
)和APC缓存破坏()。 根据需要进行调试优化。app/console cache:clear
rm -rf app/cache/*
composer update
结论:apc_clear_cache()
以上是流浪性能hacks -Sulucms案例研究的详细内容。更多信息请关注PHP中文网其他相关文章!