[英]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.