我使用 PHP v8.1 并尝试使用以下命令打开 Codeigniter (v4.2.10) 欢迎页面:php Sparkserve
并收到此错误:无法打开输入文件:spark
。< /p>
我在网上搜索过,没有找到任何相关内容。所以我尝试使用composer安装spark: composer require sparkphp/spark
但没有运气。我收到以下错误:
Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires sparkphp/spark ^0.16.3 -> satisfiable by sparkphp/spark[0.16.3]. - sparkphp/spark 0.16.3 requires destrukt/destrukt ^0.7.1 -> could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. - It's a private package and you forgot to add a custom repository to find it Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. You can also try re-running composer require with an explicit version constraint, e.g. "composer require sparkphp/spark:*" to figure out if any version is installable, or "composer require sparkphp/spark:^2.1" if you know which you need. Installation failed, deleting ./composer.json.
现在我不知道该怎么办,非常感谢您的帮助。
P粉3561286762023-11-03 09:16:15
Could not open input file: spark
表示您不在 Codeigniter 根目录中。 只需进入 Codeigniter 根目录然后运行命令即可。 如果您使用 Composer 来创建应用程序
composer create-project codeigniter4/appstarter project-root
只需转到“项目根目录”(您编写的任何名称)
cd project-root php spark serve