简体   繁体   English

通过 curl 发布时的数据库连接问题

[英]Database connection issue when posting through curl

I have a strange issue.我有一个奇怪的问题。 I'm trying to make a curl post to a page that simply connects to a database, but it is coming back as unable to connect.我正在尝试将 curl 帖子发送到仅连接到数据库的页面,但由于无法连接而返回。 If I go directly to the page in a browser, the database connects fine.如果我直接进入浏览器中的页面,则数据库连接正常。 If I do the curl post through command line on my personal computer, it works, but doing the same on the actual server it fails.如果我通过个人计算机上的命令行执行 curl post,它可以工作,但在实际服务器上执行相同操作却失败。 I have the most up to date version of curl (7.47.1) on the server.我在服务器上有最新版本的 curl (7.47.1)。 Any ideas what it could be?任何想法可能是什么?

Server specs:
Linux CentOS
apache 2.2.15
PHP 5.6.19

Using this library to make the curl requests in php:使用这个库在 php 中发出 curl 请求:
https://github.com/rmccue/Requests https://github.com/rmccue/Requests

Sorry, figured it out.抱歉,想通了。 Just in case anyone else ever runs into this, we are using a load balancer and the second server wasn't able to connect to mysql.以防万一其他人遇到这个问题,我们正在使用负载平衡器,而第二台服务器无法连接到 mysql。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM