您现在的位置是:

使用composer提示[ErrorException ]proc_get_status() has been disa

发布时间:2020-03-19作者:小灵龙来源:未知点击:86

压

从错误提示信息中可以看到是因为关闭了PHP的proc_get_status()函数,那么如何解决这个问题呢?

打开php.ini文件,搜索 disable_functions,找到如下类似内容:

disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_get_status,proc_open,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server
找到proc_get_status并删除然后重启php服务。

解决上面的提示后继续使用composer又出现了新的错误提示:[Symfony\Component\Process\Exception\RuntimeException] The Process class relies on proc_open,如图:

辊

这个是缺少了PHP的proc_open函数,解决方法同样是打开php.ini文件搜索disable_functions,删除proc_open。
disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server中的proc_open并重启php服务。

然后使用composer就正常了,上面两个问题可以看出用composer来安装drupal8模块需开启proc_open和proc_open这两个PHP函数。

2,错误:1,Warning: Module 'mysqli' already loaded in Unknown on line 0。2,Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
解决办法:
1,进入php.ini 把;extension=mysqli注释掉就可以了
2,修改 php.ini 
track_errors=On

track_errors=Off

3,(1)>composer create-project topthink/think=5.0.* tp5 --prefer-dist
      出错:[Composer\Downloader\TransportException]  Content-Length mismatch, received 66895 bytes out of the expected 1916381
      解决办法:>composer config repo.packagist composer https://packagist.phpcomposer.com 
(2)>composer config repo.packagist composer https://packagist.phpcomposer.com 
      出错:File "./composer.json" cannot be found in the current directory 
      解决办法:加上 -g [ --global ] 就可以了,用全局配置就不用去找 composer.json 文件了
(3)>composer require topthink/think-captcha

   出错:[Composer\Downloader\TransportException] Content-Length mismatch, received 28935 bytes out of the expected 1871484

   解决办法:  更换源   composer config repo.packagist composer https://packagist.phpcomposer.com
(4)>composer require topthink/think-captcha
     出错:
Using version ^3.0 for topthink/think-captcha
./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-captcha v3.0.2 requires topthink/framework ^6.0.0 -> satisfiable by topthink/framework[6.0.x-dev, v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc4, v6.0.0-rc5, v6.0.1, v6.0.2] but these conflict with your requirements or minimum-stability.
    - topthink/think-captcha v3.0.1 requires topthink/framework ^6.0.0 -> satisfiable by topthink/framework[6.0.x-dev, v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc4, v6.0.0-rc5, v6.0.1, v6.0.2] but these conflict with your requirements or minimum-stability.
    - topthink/think-captcha v3.0.0 requires topthink/framework ^6.0.0 -> satisfiable by topthink/framework[6.0.x-dev, v6.0.0, v6.0.0-rc2, v6.0.0-rc3, v6.0.0-rc4, v6.0.0-rc5, v6.0.1, v6.0.2] but these conflict with your requirements or minimum-stability.
    - Installation request for topthink/think-captcha ^3.0 -> satisfiable by topthink/think-captcha[v3.0.0, v3.0.1, v3.0.2].


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

     以上原因:不匹配composer.json要求的版本。captcha=1.* 如果不加=号也就下载最新版本的。也就是说tp6使用 captcha v3.*,tp5.0 使用captcha v1.*

    解决方案:看自己的tp版本是多少就用什么版本的captcha


 

 


如果帮到了您,请打赏一二!

标签: