我正在使用PHP fsockopen()来完成我的服务器和PayPal之间的付款。但是,当我尝试使用SSL连接时,我收到以下错误:
Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://:443
(Unable to find the socket transport "ssl" - did you forget to enable
it when you configured PHP?)
我确信我对fsockopen()方法的调用是正确的,因为在我升级开发服务器上的PHP之前,它工作正常
我使用fsockopen()在一个循环中连接到多个服务器。
然而,一些服务器是无效的,我得到如下的PHP警告:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found
有没有办法防止这些警告。
比如在尝试fsockopen之前检查服务器是否正常?
或者有没有其他或者更好的解决方案?
我正在尝试使用php函数fsockopen在smtp服务器上使用ssl,在我的本地服务器上使用apache的端口465。它在php命令行上运行得很好,但是当脚本在我的浏览器中运行时,我得到了一个SSL错误。
php.ini
extension=php_openssl.dll line is not commented
通过Apache的phpinfo
Loaded Configuration File : D:\localhost\php-5.4.11\php.ini
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL
错误日志:
[07-Mar-2016 23:26:23 Europe/Moscow] PHP Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/domeofli/public_html/test/payments.php on line 81
[07-Mar-2016 23:26:23 Europe/Moscow] PHP Warning: fsockopen(): unable to connect to ssl://www.
刚才安装了whm/cpanel,创建了一些帐户,在其中一个帐户中创建了邮件帐户,然后输入squirrelmail来检查邮件。
不幸的是,它给了我一个错误:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /usr/local/cpanel/base/3rdparty/squirrelmail/plugins/login_auth/functions.php on line 129
Warning: fsoc
我正在用etsy的开源在我的PHP脚本上设置报表。我将我的连接建立在他们给定的示例上,但我遇到了一个问题,fsockopen似乎忽略了try/catch,并打印出它的错误。
当statsd服务器启动并运行时,一切都会正常工作-但如果它关闭了或者php脚本无法连接到它:
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed:
Name or service not known
我甚至尝试在fsockopen前面添加@,但没有成功。它似乎完全忽略了超时设置,因为它需要大约20秒才能返回错误:
try
我正在使用fsockopen从UDP地址获取信息,唯一的问题是一些UDP地址可能仍然不活动。
我通过以下方式创建套接字
$fp = fsockopen($tracker, $port, $errno, $errstr, 1);
如果地址有效,则一切正常,但如果地址无效,则会生成此错误
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in
我尝试过这样做,但仍然会产生错误,
if(!$fp = fsockopen($tracker, $port, $errn
我对fsockopen有问题。我的网站工作正常,但当我登录到管理面板(wordpress),我得到了这个错误信息在我的屏幕上:Warning: fsockopen() [function.fsockopen]: unable to connect to udp://:0 (Failed to parse address "") in /home/visit014/public_html/wp-admin/function.php on line 32
wp-admin/function.php的代码如下:
`<?php
//=====================
我有一个关于fsockopen()的问题。
当我从编写代码时,它不工作,并且我得到:
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:port
(No connection could be made because the target machine actively refused it. )
in C:\xampp\htdocs\PhpMQTTClient-master\SAM\MQTT\sam_mqtt.php on line 641
Offline
我试过,但它不能解决我的问题。
有
类似的问题以前已经回答过了,但我还没能解决这个特殊的问题。
在PHP机器上,当我试图在一个特定的域上使用5.6+时,我收到以下信息(不是真正的域):
$ php -r "var_dump(fsockopen(\"ssl://www.domain.net\", 9085, \$errnum, \$errstr, 5));"
PHP Warning: fsockopen(): Failed to enable crypto in Command line code on line 1
PHP Warning: fsockopen(): unable to con
我使用此代码检查了fsockopen,该功能已启用。
<?php
if(function_exists('fsockopen')) {
echo "fsockopen function is enabled";
}
else {
echo "fsockopen is not enabled";
}
?>
下面是我需要使用的脚本使用的代码。返回错误: fsockopen-function不工作,错误: 110连接超时-失败
if (isset($_SERVER['HTTPS']) &&
我试图在本地主机上的codeigniter中发送电子邮件,但它显示以下错误。我已经配置了电子邮件库和gmail帐户。任何人对此都有解决方案。
A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when y
I have to build a php website which has to connect to an Ingres database server.
我已经下载了sourceforge pjbs JDBC-PHP桥。我将其安装在项目文件夹中,并尝试连接到我的ingres数据库。我不知道fsockopen()需要哪些参数,对于数据库主机(VMS服务器),我使用vnode,但ingres使用字符串作为端口,而fsockopen需要一个整数。我在Windows 7 Ingres 9.2上使用php 7.2.3在HP OpenVMS v.8.4上使用
<?php
require &
最近,当我尝试升级docker文件的php版本时,我开始收到CloudSQL连接错误。
日志示例。
2019-08-08T06:58:25.612096Z POST200 474 B 38 ms Chrome 75 /index.php?p=mangomin/actions/install/validate-db
2019-08-08T07:00:12.134410Z CloudSQL connection failed. Please see https://cloud.google.com/functions/docs/sql#troubleshooting for additional
我正在尝试获取我使用的远程web page.When中使用的所有图像/css/js文件的HTTP响应头
fsockopen('mydomain.com',80,$errsno,$errstr,20)
当我试图对我的网页中的css链接做同样的操作时,就像,
fsockopen('mydomain.com/style.css',80,$errno,$errstr,20)
它返回错误
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: No such host is known
Wa
当用户注册后,我想向用户发送确认电子邮件。我使用的是xampp。当我运行我的php文件时,它返回以下错误:
Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in C:\xampp\htdocs\class.smtp.php on line 122