简体   繁体   English

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

[英]PHP - Apache - MySQL Server | Could not connect to host

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. 我现在在Google上工作了6个多小时,试图找出解决方案。

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, ... 我已经试过 ,设置对所有的php.ini文件300或无限超时,我已尝试设置MySQL的缓冲更高,尝试重新启动Apache和MySQL服务器,...

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')); 问题:在发生错误的地方,我要执行的操作是执行SOAP命令(命令正确) $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'); "Could not connect to host" ->如果设置了 define('DB_HOST', '127.0.0.1'); or 要么


Problem 2: 问题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'); "Database connection failed: Can't connect to MySQL server on 'blacktempel.dyndns-home.com' (10060)" ->如果设置了 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. MySQL在端口3306上运行并正在侦听。 My other defines, such as DB_USER , DB_PASS , are correct. 我的其他定义(例如DB_USERDB_PASS )是正确的。

Q: Why won't it work ? 问:为什么不起作用? What could be wrong ? 有什么问题吗? Is there anything I could possibly have missed ? 我有什么想念的吗?

Fixed the issue. 解决了该问题。

The SOAP problem was caused by a setting in the config file of the program accessed by SOAP. SOAP问题是由SOAP访问的程序的配置文件中的设置引起的。

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

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