Skip to content

CURL & Remote Mysql is not working

0

Curl and remote mysql is not working by php Curl is working on console not in PHP remote mysql not able to access time out is coming fom cpanel able to ping the server Elastic Ip also white-listed even it's not working . What may be the reason is not woring with one particular server with other server its working fine

    1. Ping also not working with that server
    2. But from non aws to aws is working
    3. aws to non aws is working
asked a year ago251 views
2 Answers
-1

Hello.

What are the security group's inbound rules configured?
If RDS does not enable public access, access from EC2 to RDS will be private access, so you will not be able to communicate even if you register ElasticIP.
If it is a private connection, please refer to the EC2 private IP address and EC2 security group in the security group in the inbound rule.
https://docs.aws.amazon.com/quicksight/latest/user/vpc-security-groups.html#vpc-inbound-rules

EXPERT
answered a year ago
  • For a instance given INBOUND OUTBOUND AS ALL TRAFFIC STILL ISSUE IS THERE .

    For Diffrent server is working fine for a one particular server is not working

    WHAT i did is Sub domain taken from one server that pointed to this cpanel public address then domain is working now from old server have one database from that database need to access data its not working but diffrent server is working fine under same account in In motion hosting

    ping server also not working but public ip is showing

-1

Maybe we need to clarify your question first. Just Assume your scenario is about connecting to RDS from EC2 from the same VPC, correct me if in need. Based on the information you provided, I have summarized the key points of the issue:

  1. The cURL function in PHP is not working correctly, but running cURL commands in the console works fine.
  2. Unable to access a remote MySQL server from cPanel, resulting in a timeout error.
  3. The server is pingable, but the connections still fail.

Possible reasons and troubleshooting steps:

  1. security group setting a. ensure the outbound rule allow 3306 port to RDS instance; you can configure a rule that allow access to the security group of rds;
  2. PHP environment configuration (Most likely the root cause in this case) a. Verify that the cURL extension is correctly installed and enabled in PHP. b. Check the PHP connection timeout settings.
  3. MySQL configuration a. make sure the inbound rule of RDS MySQL allows access from EC2, you can also configure a inbound rule to allow access from the security group of EC2; you can also refer to the following docs to identify the root cause in your case .
  4. https://repost.aws/knowledge-center/rds-cannot-connect
  5. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html

I hope you found this helpful. If you face any other issues or require further assistance, you could also reach out to AWS Support along with your use case details, and we would be happy to assist you further. Thank you!

AWS
answered a year ago
  • im connecting from with AWS to non aws server for database

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.