CI4入门问题



决定尝试一下新发布的CI4。

Ubuntu操作系统与php 7.4.3。

以下文档位于https://codeigniter4.github.io/userguide/installation/index.html

composer create-project codeigniter4/appstarter c400
cd c400
# Not sure if this is needed
php builds development
composer update # per the build's output
php spark serve

结果是:

CodeIgniter CLI Tool - Version 4.0.1 - Server-Time: 2020-02-24 10:41:36am
PHP Fatal error:  Cannot declare class CodeIgniterCommandsCommandsTestStreamFilter, because the name is already in use in /home/ahundiak/zayso2020/c400/tests/_support/Commands/CommandsTestStreamFilter.php on line 3
PHP Stack trace:
PHP   1. {main}() /home/ahundiak/zayso2020/c400/spark:0
PHP   2. CodeIgniterCLIConsole->run() /home/ahundiak/zayso2020/c400/spark:57
PHP   3. CodeIgniterCodeIgniter->run() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/Console.php:86
PHP   4. CodeIgniterCodeIgniter->handleRequest() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CodeIgniter.php:306
PHP   5. CodeIgniterCodeIgniter->runController() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CodeIgniter.php:398
PHP   6. CodeIgniterCLICommandRunner->_remap() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CodeIgniter.php:906
PHP   7. CodeIgniterCLICommandRunner->index() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:86
PHP   8. CodeIgniterCLICommandRunner->createCommandList() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:103
PHP   9. class_exists() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:167
PHP  10. spl_autoload_call() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:167
PHP  11. ComposerAutoloadClassLoader->loadClass() /home/ahundiak/zayso2020/c400/vendor/codeigniter4/codeigniter4/system/CLI/CommandRunner.php:167
PHP  12. ComposerAutoloadincludeFile() /home/ahundiak/zayso2020/c400/vendor/composer/ClassLoader.php:322
PHP  13. include() /home/ahundiak/zayso2020/c400/vendor/composer/ClassLoader.php:444
An uncaught Exception was encountered
Type:        ErrorException
Message:     Cannot declare class CodeIgniterCommandsCommandsTestStreamFilter, because the name is already in use
Filename:    /home/ahundiak/zayso2020/c400/tests/_support/Commands/CommandsTestStreamFilter.php
Line Number: 3

这个错误与Symfony在首次引入预加载时产生的一些错误没有什么不同。但7.4.3至少解决了Symfony的问题。

我开始逐步完成spark控制台代码,但我想看看是否有其他人遇到过这种情况。

更新:来自https://forum.codeigniter.com/thread-75587.html,看来这个问题正在解决中。当修复程序发布时,我会回来关闭它。

等待了几天才发布修复程序。做了一个composer更新,将我从CLI 4.0.1移到了4.0.2,但问题仍然存在。

做了一个新项目,一切如愿以偿。

不确定composer更新是否应该起作用,但至少现在显示了欢迎页面。

相关内容

  • 没有找到相关文章

最新更新