Laravel4中安装Stone
安装依赖包, 如果你需要Stone-Server,则不需要安装runkit。
sudo pecl install swoole sudo pecl install runkit
composer安装Stone
composer require qufenqi/stone:dev-laravel-4.x
修改app/config/app.php, 加载Stone的Service Provider,
'providers' => array( 'Illuminate\Foundation\Providers\ArtisanServiceProvider', 'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Cache\CacheServiceProvider', ... ... ... 'Qufenqi\Stone\StoneServiceProvider', ),
配置Stone: 新建 app/config/stone.php
return [ // server模式配置 'server' => [ 'handler' => 'App\Servers\Handler', // request handler 'user' => 'apple', // run user 'group' => 'apple', // run group 'domain' => '/var/run/stone-server-fpm.sock', 'pid' => '/run/stone-fpm.pid', 'process_name' => 'stone-server-fpm', 'worker_num' => 30, ], // web模式配置 'web' => [ 'user' => 'apple', // run user 'group' => 'apple', // run group 'domain' => '/var/run/stone-web-fpm.sock', // unix domain socket 'pid' => '/run/stone-web.pid', 'process_name' => 'stone-web-server', 'worker_num' => 30, 'boot-manifest' => storage_path().'/meta/stone/boot', 'request-manifest' => storage_path().'/meta/stone/request', // 需要建立快照的绑定 'snap_bindings' => [ 'view', 'db', 'cookie', 'session', 'session.store', //'config', // debugbar 需要重置config ], ], ];