douchushao7799 2014-12-14 09:33
浏览 32
已采纳

PHP - Apache - MySQL服务器| 无法连接到主机

I'm facing this problem since yesterday evening. I have been now over 6 hours on Google, trying to figure out what the solution could be.

I have tried this, setting the timeout on all php.ini files to 300 or unlimited, I have tried setting the buffer of MySQL higher, tried to restart both Apache and MySQL server, ...

Problem: What I'm trying to do, where the error occurs, is to execute a SOAP-command (command is correct) $this -> soap -> executeCommand(new SoapParam($command, 'command'));, which results in:

"Could not connect to host" --> if I set define('DB_HOST', '127.0.0.1'); or


Problem 2:

 //Warning: mysqli::mysqli() [function.mysqli-mysqli]: (HY000/2003): Can't connect to MySQL server on 'blacktempel.dyndns-home.com' (10060) in C:\Users\NAME\Desktop\Server_09122014\Apache\_Server\htdocs\SOAPRegistration.php on line 109
 //Warning: mysqli::close() [function.mysqli-close]: Couldn't fetch mysqli in C:\Users\NAME\Desktop\Server_09122014\Apache\_Server\htdocs\SOAPRegistration.php on line 154


$this -> db = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT); //Line 109
$this -> db -> close(); //Line 154

"Database connection failed: Can't connect to MySQL server on 'blacktempel.dyndns-home.com' (10060)" --> if I set define('DB_HOST', 'blacktempel.dyndns-home.com');.

My firewall is not the problem, I have checked this multiple times.

My hosts file contains this:

#       127.0.0.1       localhost
#       ::1             localhost
        MyExternalIp    blacktempel.dyndns-home.com

SOAP:

define('SOAP_IP', '127.0.0.1');
define('SOAP_PORT', '7878');

MySQL is running on port 3306 and listening. My other defines, such as DB_USER, DB_PASS, are correct.

Q: Why won't it work ? What could be wrong ? Is there anything I could possibly have missed ?

  • 写回答

1条回答 默认 最新

  • dpl57372 2015-01-07 09:59
    关注

    Fixed the issue.

    The SOAP problem was caused by a setting in the config file of the program accessed by SOAP.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分