liziyu 发布的文章

第一步:我用的是宝塔环境,所以出现下面红色的提醒

1.png
    【图1】

第二步:将找到php.ini配置文件,宝塔环境直接在后台找即可,把环境中禁用的pcntl_signal_dispatch删除并保存。

2.png
    【图2】

结论:重启服务器再次输入图1中的校验,出现图2提示说明正常使用workerman环境了。

安装: fileinfo扩展。

删除:禁用函数:pcntl_alarpcntl_wait

如下图的提示,安装fileinfo扩展。

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - topthink/think-worker v3.0.4 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - topthink/think-worker v3.0.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - topthink/think-worker v3.0.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - topthink/think-worker v3.0.1 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - topthink/think-worker v3.0.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - Installation request for topthink/think-worker ^3.0 -> satisfiable by topthink/think-worker[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4].

  To enable extensions, verify that they are enabled in your .ini files:
    - /www/server/php/73/etc/php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

empty判断各种特殊表达式是否为空的使用方法:

$a='';
$b=NULL;
$c=0;
$d=-1;
$e=false;
$f=true;
 
echo 'a is empty:'.empty($a).'<br/>';
echo 'b is empty:'.empty($b).'<br/>';
echo 'c is empty:'.empty($c).'<br/>';
echo 'd is empty:'.empty($d).'<br/>';
echo 'e is empty:'.empty($e).'<br/>';
echo 'f is empty:'.empty($f).'<br/>';

输出结果:

a is empty:1
b is empty:1
c is empty:1
d is empty:
e is empty:1
f is empty: