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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器