从错误提示信息中可以看到是因为关闭了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