Google Cloud Function - PHP - “主脚本未知”

问题描述 投票:0回答:1

GCP 云函数,PHP 8.2,触发 PubSub 事件,遇到错误:

FastCGI 在 stderr 中发送:“主脚本未知”,同时从上游读取响应头

尽管有一个有效的

index.php
并传递了适当的公共函数
CloudEvent $cloudevent
对象。

php google-cloud-functions composer-php
1个回答
0
投票

如果您的

composer.json
config
节点具有
bin-dir
覆盖,就会发生这种情况。

GCP云功能魔法想要运行:

Starting app (pid 12): /bin/sh -c exec serve -enable-dynamic-workers -workers=1024 vendor/bin/router.php

专门在

router.php
寻找
vendor/bin

GCP 也许应该阅读并遵守

bin-dir
配置,但可惜。一旦删除
bin-dir
覆盖,它就会起作用:

    "config": {
        "bin-dir": "// Remove this line"
    },
© www.soinside.com 2019 - 2024. All rights reserved.