【问题标题】:install python in php appengine in gcp在 gcp 的 php appengine 中安装 python
【发布时间】:2020-02-04 12:06:14
【问题描述】:

我正在尝试在 PHP 应用程序引擎中通过 PHP 运行 python 脚本,我做了一个 helloworld 脚本,它使用 PHP 在本地运行:

$command = escapeshellcmd("python test.py");
$output = shell_exec($command);

但是当我将它发送到 appengine 并尝试触发时,我在服务日志中收到以下消息:

WARNING: [pool app] child 16 said into stderr: "sh: 1: python: not found"

【问题讨论】:

    标签: python php google-app-engine


    【解决方案1】:

    App Engine 无法做到这一点。您需要将 Python 服务添加到您的 App Engine 应用或用 PHP 重写 Python 代码。

    【讨论】:

    • 我是否可以创建另一个服务,以便第一个(用 PHP 编写)调用它来执行一些数据工程工作,这样第一个服务就像第二个服务的触发器一样?
    • 是的,你可以有两个服务一个调用另一个
    猜你喜欢
    • 1970-01-01
    • 2022-06-30
    • 2021-04-30
    • 2020-08-02
    • 2019-03-31
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多