關鍵點:
和https://test.app/admin
都應明顯更快。 https://test.app
>
在Vagrant上設置並優化sulu
我們將使用宅基地的改進,但是這些原則廣泛適用。>
1。初始設置:
git clone https://github.com/swader/homestead_improved hi_sulu cd hi_sulu; bin/folderfix.sh
Homestead.yaml
(提供的Nginx配置至關重要;根據非霍姆斯特德環境的需要進行適應。)
- map: test.app to: /home/vagrant/Code/sulu/web type: symfony-sulu
2。 Vagrant和Sulu安裝:
啟動VM和SSH:
vagrant up; vagrant ssh
test.app
(地址潛在的PHP版本衝突;必要時使用/etc/hosts
。
cd Code git clone https://github.com/sulu-io/sulu-standard sulu; cd sulu git checkout master composer install
運行構建命令(開發環境):sudo apt-get upgrade php7.0-fpm
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/*
app/console sulu:build dev
app/console assetic:dump
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中文網其他相關文章!