简体   繁体   English

如何从弹性豆茎上的 PHP 按需运行 python 脚本?

[英]How can I run a python script on demand from my PHP on Elastic beanstalk?

I set up a PHP web app on Elastic beanstalk (AWS), but I'd like to run a python script on demand ( click on button).我在 Elastic beanstalk (AWS) 上设置了 PHP web 应用程序,但我想按需运行 python 脚本(单击按钮)。 My python script will update the database, and I will extract the result thanks to PHP.我的 python 脚本将更新数据库,感谢 PHP,我将提取结果。 I don't know if anyone has good recommendations to do this, and if anyone can explain how to do it because I can't find a clear explanation on this topic.我不知道是否有人对此有很好的建议,以及是否有人可以解释如何做,因为我找不到关于这个主题的明确解释。

A really good alternative would be to create an AWS Lambda function in Python, triggered by AWS API Gateway, such as the following architecture:一个非常好的替代方案是在 Python 中创建一个 AWS Lambda function,由 AWS ZDB974238714CA8ADE4FZA 触发,如下架构:

在此处输入图像描述

In your PHP code, when the button is clicked, you will make an API Call to API Gateway, that will trigger the Lambda function, and update the database and return the desired result. In your PHP code, when the button is clicked, you will make an API Call to API Gateway, that will trigger the Lambda function, and update the database and return the desired result.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用AWS Elastic Beanstalk在URL中使用参数运行PHP脚本? - How Do I Run PHP Script with parameters in URL with AWS Elastic Beanstalk? 如何确定Elastic Beanstalk是否正在运行我的配置文件? - How can I tell if Elastic Beanstalk is running my config files? 如何确保我的PHP脚本仅作为计划作业而不是从浏览器运行? - How can I ensure my PHP script is only run as a schedule job and not when run from a browser? 是否可以将Python2添加到AWS Elastic Beanstalk PHP平台? - Could I add Python2 to AWS Elastic Beanstalk PHP platform? PHP-如何在不重启rds的情况下将aws.push混入弹性beantalk? - PHP - How can I git aws.push to elastic beanstalk without restarting rds? 如何将zend framework 2应用程序部署到AWS Elastic beantalk? - How can I deploy my zend framework 2 application to AWS elastic beanstalk? 如何调整服务器以更快地运行PHP脚本? - How can I adjust the server to run my PHP script quicker? 如何从需要以root身份在PHP页面上运行的Python脚本返回输出? - How can I return the output from a Python script that needs to be run as root on a PHP page? 如何运行包含来自heroku托管的php库的python脚本? - How can I run the python script which contain libraries from php hosted on heroku? Run Python script at start-up from php when python script is stored on a raspberrypi not in the same computer I have my php script on? - Run Python script at start-up from php when python script is stored on a raspberrypi not in the same computer I have my php script on?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM