Jupyter Notebook 安装 PHP 内核
普通安装 安装zmq扩展 官方的 zmq 已多年不维护了,并且在php7.4中报错,所以只能选择第三方的了 wget https://github.com/stijnvdb88/php-zmq/archive/refs/tags/v4.3.4.tar.gz tar -xvzf php-zmq-4.3.4.tar.gz …
关于 php 的技术笔记与实践,集中在这里。
普通安装 安装zmq扩展 官方的 zmq 已多年不维护了,并且在php7.4中报错,所以只能选择第三方的了 wget https://github.com/stijnvdb88/php-zmq/archive/refs/tags/v4.3.4.tar.gz tar -xvzf php-zmq-4.3.4.tar.gz …
项目中存储金额一般用 int (分),或者 decimal(8,2) ,如果用 decimal 会涉及到精度问题。比如:比较字符串 0.01 和 0 哪个大,结果是一样大,因为php会把 0.01 强转为 0 ,这就不符合预期了 #两个任意精度的数字除法计算 bcdiv('200', '100', 2);//分转元,2…
安装 PHP Archive (PHAR) wget -O phpunit https://phar.phpunit.de/phpunit-9.phar chmod +x phpunit root@php-fpm:/var/www/html# ./phpunit --version PHPUnit 9.5.27 by …
安装 composer require --dev phpstan/phpstan 修改composer.json "scripts": { ... "stan": [ " php -d memory_limit=-1 vendor/bin/phpstan analyse app routes database con…
安装 composer require --dev friendsofphp/php-cs-fixer 修改composer.json "scripts": { ... "cs-diff": [ "vendor/bin/php-cs-fixer fix --verbose --diff --dry-run" ], "c…
做PHP开发也很多年了,Xdebug也配过很多次,但总觉得不是刚需,感觉有没有都行;另一方面它配置复杂(新方法很简单),每个项目都得配一遍(新方法也避免不了),并且在公司配完,回到家还得修改hosts 中的ip(新方法不需要)。种种原因,使用Xdebug的习惯并没有延续下来。直到我近日接触了yii2中的事件,比如: $…
安装 composer require yiisoft/yii2-queue 配置 //cat config/console.php return [ 'bootstrap' => [ 'queue', ], 'components' => [ 'redis' => [ 'class' => 'yii\redis\Co…
前提 protoc(the protobuf compiler binary to generate PHP classes for your messages and service definition.) grpc_php_plugin(a plugin for protoc to generate the se…
Laravel-debugbar 可以打印出每个请求执行的sql 安装 composer require barryvdh/laravel-debugbar 执行完即可,打开任一html页面(返回json的不行) 更详细的说明请参考: https://github.com/barryvdh/laravel-debugb…
开启 vi config/main.php if (YII_ENV_DEV) { $config['bootstrap'][] = 'debug'; $config['modules']['debug'] = [ 'class'=>'yii\debug\Module', 'allowedIPs'=>['*',], ];…