PHP 缓存优化

OPcache 是 PHP 中的 Zend 扩展,可以大大提升 PHP 的性能。 OPcache 通过将 PHP 脚本预编译的字节码存储到共享内存中来提升 PHP 的性能, 存储预编译字节码的好处就是 省去了每次加载和解析 PHP 脚本的开销。

阅读更多

PHP-FPM 编译

适用于 centosdebainubuntu 系统进行编译安装与部署

安装编译所需开发库

  • centos 下执行安装
script
1
yum install -y libacl libacl-devel libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel enchant enchant-devel gd gd-devel gmp gmp-devel libmcrypt libmcrypt-devel libtidy libtidy-devel libxslt libxslt-devel argon2 libargon2-devel libtidy libtidy-devel gcc gcc-c++ autoconf automake zlib zlib-devel pcre-devel
  • 如果是 debainubuntu 下执行安装
script
1
apt-get install libacl1 libacl1-dev libxml2 libxml2-dev libbz2-dev libcurl3 libcurl3-dev enchant libenchant-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libgmp3-dev libmcrypt-dev libtidy-dev libxslt-dev libssl-dev libargon2-0 libargon2-0-dev build-essential libpcre3 libpcre3-dev autoconf zlib1g-dev
阅读更多

PHP CURL 证书问题

如出现该错误, 未正确配置 CA 证书

1
curl: (60) SSL certificate : unable to get local issuer certificate

下载证书 http://curl.haxx.se/ca/cacert.pem, 配置 php.ini

1
curl.cainfo = "/usr/local/php/cacert.pem"

搭建 Satis 私有 Packagist

使用 composer 初始化 Satis 项目

1
# composer create-project composer/satis --keep-vcs

删除默认 composer.lock,重新安装依赖

1
2
# composer install
# composer dump-autoload --optimize
阅读更多

Lumen FAQ

安装

1
composer require illuminate/cookie

配置

1
2
3
4
5
$app->singleton('cookie', function () use ($app) {
return $app->loadComponent('session', 'Illuminate\Cookie\CookieServiceProvider', 'cookie');
});

$app->bind('Illuminate\Contracts\Cookie\QueueingFactory', 'cookie');