#!/bin/bash
php artisan down
git pull
composer clearcache && composer dumpautoload
php artisan config:cache
php artisan optimize
php artisan up
php artisan down
git pull
composer clearcache && composer dumpautoload
php artisan config:cache
php artisan optimize
php artisan up
进入项目根目录, 如我的在 /var/www/laravel
cd /var/www/laravel
执行 composer dump-autoload –-optimize
执行 php artisan optimize –-force
开启 zend OPcache
如果没有安装 zend OPcache , 请执行如下命令安装: (在php5.6上测试通过)
yum install php-opcache -y
service nginx restart
service php-fpm restart
安装完毕运行 php -v,会出现Zend OPcache的版本信息
[root@vagrant-centos65 vagrant]# php -v
PHP 5.6.13 (cli) (built: Sep 5 2015 07:10:08)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies