No se puede encontrar el transporte de socket " https"
Estoy usando esto para comprobar la disponibilidad de una URL:
$fp = fsockopen($url, 443, $errno, $errstr);
Y obtengo este error de vuelta...
Advertencia: fsockopen () [función.fsockopen]: no se puede conectar a https://example.com/soapserver.php:443 (No se puede encontrar el transporte de sockets "https" - ¿olvidó habilitarlo cuando configuró PHP?) en C:\Home etc etc....
Estoy usando un servidor IIS por cierto, (no, no es mi trabajo! ) así que creo que es algo que ver con no tener open-ssl, pero estoy no estoy seguro. Alguien puede ayudar por favor?
Hice un phpinfo() y tengo ssl, pero en IMAP y cURL, eso es todo.
¿Alguna idea?
6 answers
También para ssl es necesario prefijar el host con ssl: / /
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-12-18 17:41:27
Descomente la línea: extension=php_openssl.dll
en php.ini
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-01-31 00:16:45
Debería usar solo el nombre de host, no la URL en la llamada fsockopen. Tendrá que proporcionar el uri, menos el host / puerto en las cabeceras HTTP reales. Como señaló @Martijin, y como se indica en la página de manual, necesitará prefacio de su nombre de host con ssl: / / para SSL o tls: / / si usa transport layer security.
Página de manual para fsockopen. Mira el Ejemplo #1.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-12-18 18:22:07
Digamos que querías tomar NY Times, que impone HTTPS:
Incorrecto:
$client = stream_socket_client('https://www.nytimes.com', $errno, $errstr, 30);
Correcto:
$client = stream_socket_client('tcp://www.nytimes.com:443', $errno, $errstr, 30);
Tenga en cuenta que he reemplazado https://
con tcp://
y agregado el puerto 443 al nombre de host.
Supongo que podemos decir que stream_socket_client()
no habla URLs.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-19 12:49:17
Compruebe curl instalado o no para php. si no está instalado, instale el curl. para windows Descomente la línea: extension = php_openssl.dll en php.ini, para ubuntu sudo apt-get install php-curl
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-11 11:22:42
Cambiar a ssl://
funcionó para mí, pero seguí recibiendo una respuesta de solicitud INCORRECTA. Descubrí que necesitaba agregar una línea más para declarar explícitamente mi encabezado de host como se describe aquí y asegurarme de que he actualizado mi HTTP de HTTP/1.0
a HTTP/1.1
:
$header .= "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Host: www.sandbox.paypal.com\r\n";
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:03:07