Skip to content

Commit

Permalink
Silence fsockopen so that it does not issue a warning on some setups.
Browse files Browse the repository at this point in the history
Avoids output like this (see the {"status":"starting"} at the end):

Warning: fsockopen(): unable to connect to localhost:9982 (Cannot assign requested address) in /var/www/html/custom_apps/richdocumentscode/proxy.php on line 187

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/custom_apps/richdocumentscode/proxy.php:187) in /var/www/html/custom_apps/richdocumentscode/proxy.php on line 191

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/custom_apps/richdocumentscode/proxy.php:187) in /var/www/html/custom_apps/richdocumentscode/proxy.php on line 192
{"status":"starting"}
  • Loading branch information
kendy committed Jun 12, 2020
1 parent ca3b3db commit b4fbf92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function getallheaders()

// If we can't get a socket open in 3 seconds when that is backed by
// a dedicated thread, then we have a server missing in action.
$local = fsockopen("localhost", 9982, $errno, $errstr, 3);
$local = @fsockopen("localhost", 9982, $errno, $errstr, 3);

// Return the status and exit if it is a ?status request
if ($statusOnly) {
Expand Down

0 comments on commit b4fbf92

Please sign in to comment.