Bug #76856 [Opn->Nab]: When i called stream_socket_client gives error message of
| From: | cmb@php.net | Date: | Mon, 10 Sep 2018 14:42:44 +0000 |
| Subject: | Bug #76856 [Opn->Nab]: When i called stream_socket_client gives error message of | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216960@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76856&edit=1
ID: 76856
Updated by: cmb@php.net
Reported by: sushil dot adsare at konnet dot co dot in
Summary: When i called stream_socket_client gives error
message of
-Status: Open
+Status: Not a bug
Type: Bug
Package: Streams related
Operating System: windows 10
PHP Version: 5.6.37
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
(note that PHP 5.6 and 7.0 are no longer actively supported,
see <http://php.net/supported-versions.php>)
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2018-09-10 12:51:30] sushil dot adsare at konnet dot co dot in
Description:
------------
---
From manual page: http://www.php.net/function.stream-socket-client
---
$socket = stream_socket_client($client,$errorno, $errorstr, $timeout);
Comment Code Just for U r info
//$socket = stream_socket_client('tcp://127.0.0.1:7014',$errorno,
$errorstr, $timeout);
echo($errorstr." errorstr!!!\n");
/* Set the timeout */
stream_set_timeout($socket, $timeout);
/* Send the command */
if(!fwrite($socket, $snd_msg))
{
echo($client." Error while writing!!!\n");
}
if (!($rcv_msg = fread($socket, 1024)))
{
echo($client." Error while reading!!!\n");
}
else
{
}
errorstr echo print error Message -
no connection could be made because the target machine actively refused it
and also give another error in html format on cmd
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 10.0 Detailed Error - 405.0 - Method Not Allowed</title>
</head>
<body>
<div id="content">
<div class="content-container">
<h3>HTTP Error 405.0 - Method Not Allowed</h3>
<h4>The page you are looking for cannot be displayed because an invalid method (HTTP verb)
is being used.</h4>
</div>
<div class="content-container">
<fieldset><h4>Most likely causes:</h4>
<ul> <li>The request sent to the Web server used an HTTP verb that is not allowed by
the module configured to handle
the request.</li> <li>A request was sent to the server that contained an invalid
HTTP verb.</li> <li>The request
is for static content and contains an HTTP verb other than GET or HEAD.</li> <li>A
request was sent to a virtual dire
ctory using the HTTP verb POST and the default document is a static file that does not support HTTP
verbs other than GET
or HEAD.</li> </ul>
</fieldset>
</div>
<div class="content-container">
<fieldset><h4>Things you can try:</h4>
<ul> <li>Verify the list of verbs enabled for the module handler this request was
sent to, and ensure that this verb
should be allowed for the Web site.</li> <li>Check the IIS log file to see which
verb is not allowed for the requ
est.</li> <li>Create a tracing rule to track failed requests for this HTTP status
code. For more information about
creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>.
</l
i> </ul>
</fieldset>
</div>
<div class="content-container">
<fieldset><h4>Detailed Error Information:</h4>
<div id="details-left">
<table border="0" cellpadding="0" cellspacing="0">
<tr
class="alt"><th>Module</th><td> StaticFileModule</td></tr>
<tr><th>Notification</th><td> ExecuteRequestHandler</td></tr>
<tr
class="alt"><th>Handler</th><td> StaticFile</td></tr>
<tr><th>Error
Code</th><td> 0x80070001</td></tr>
</table>
</div>
<div id="details-right">
<table border="0" cellpadding="0" cellspacing="0">
<tr class="alt"><th>Requested
URL</th><td> http://localhost:80/iisstart.htm</td></tr>
<tr><th>Physical
Path</th><td> C:\inetpub\wwwroot\iisstart.htm</td></tr>
<tr class="alt"><th>Logon
Method</th><td> Anonymous</td></tr>
<tr><th>Logon
User</th><td> Anonymous</td></tr>
</table>
<div class="clear"></div>
</div>
</fieldset>
</div>
<div class="content-container">
<fieldset><h4>More Information:</h4>
This error means that the request sent to the Web server contained an HTTP verb that is not
allowed by the configured
module handler for the request.
<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&IIS70Error=405,0,0x80070001,14393">View
more information
»</a></p>
</fieldset>
</div>
</div>
</body>
</html>
I just send data send info though socket.
this code is working previously but after system update it shows error.
i know it may be any permission issue but i don't understand.
i tries some
1 add all feature in iis 10
2 add http handler mapping(verbs)in my server website which is host on iis 10
Test script:
---------------
function send_anx_app_msg($client)
{
$rcv_msg = "";
$timeout = 10;
$snd_msg = "STATUS_MONITOR";
$socket = stream_socket_client($client,$errorno, $errorstr, $timeout);
//$socket = stream_socket_client('tcp://127.0.0.1:7014',$errorno, $errorstr,
$timeout);
echo($errorstr." errorstr!!!\n");
/* Set the timeout */
stream_set_timeout($socket, $timeout);
/* Send the command */
if(!fwrite($socket, $snd_msg))
{
echo($client." Error while writing!!!\n");
}
if (!($rcv_msg = fread($socket, 1024)))
{
echo($client." Error while reading!!!\n");
}
else
{
}
fclose($socket);
return $rcv_msg;
}
Expected result:
----------------
it just connect and send on socket
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76856&edit=1