Title: stream_set_timeout error filling logs
Last modified: July 3, 2019

---

# stream_set_timeout error filling logs

 *  Resolved [Spiffy Plugins](https://wordpress.org/support/users/spiffyplugins/)
 * (@spiffyplugins)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/stream_set_timeout-error-filling-logs/)
 * My server error logs are filling with the following error message, generated 
   by WordFence:
 * stream_set_timeout() expects parameter 1 to be resource, boolean given in …/wp-
   content/plugins/wordfence/modules/login-security/classes/controller/time.php 
   on line 98
 * Please advise on how to fix this problem. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/stream_set_timeout-error-filling-logs/#post-11696860)
 * Hey [@spiffyplugins](https://wordpress.org/support/users/spiffyplugins/),
 * It looks like `fsockopen()` is failing for some reason.
 * Can you send me a **Diagnostics** report so I can get a better overview of your
   environment? Please navigate to **Wordfence** > **Tools** > **Diagnostics**. 
   Here you can select `SEND REPORT BY EMAIL`. Please include your WordPress.org
   username and update this thread after you’ve sent it.
 * In the meantime, if you’re comfortable with it you can remove the `@` character
   in front of `fsockopen` in **time.php** on line **97**. The `@` character is 
   to suppress errors, removing it might log a more useful error. After you’ve don’t
   this and have seen the new error please re-add the `@`.
 * This is the path to find the code:
    `/wp-content/plugins/wordfence/modules/login-
   security/classes/controller/time.php`
 * Please let me know how it goes.
 * Thanks,
 * Gerroald
 *  Thread Starter [Spiffy Plugins](https://wordpress.org/support/users/spiffyplugins/)
 * (@spiffyplugins)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/stream_set_timeout-error-filling-logs/#post-11697174)
 * The issue is the socket connection is failing due to permission denied. I believe
   the problem is that the stream_set_timeout is called even if the fsockopen fails.
   It should be called within the if ($socket) statement:
 *     ```
       foreach ($servers as $s) {
       	$socket = @fsockopen('udp://' . $s, 123, $err_no, $err_str, 1);
       	if ($socket) {
       		stream_set_timeout($socket, 1);
       		...etc
       ```
   
    -  This reply was modified 6 years, 10 months ago by [Spiffy Plugins](https://wordpress.org/support/users/spiffyplugins/).
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/stream_set_timeout-error-filling-logs/#post-11697267)
 * Hey [@spiffyplugins](https://wordpress.org/support/users/spiffyplugins/),
 * Thanks for the update, and sharing this.
 * I’ve shared this with the developers and they’ve created a report for it. I’ll
   be sure to update you when I find out if adjustments will be made in the next
   release.
 * Thanks,
 * Gerroald
 *  [WFGerroald](https://wordpress.org/support/users/wfgerald/)
 * (@wfgerald)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/stream_set_timeout-error-filling-logs/#post-11697304)
 * Hey [@spiffyplugins](https://wordpress.org/support/users/spiffyplugins/),
 * I just wanted to let you know that this will be in the next release.
 * Please let us know if anything else comes up.
 * Thanks,
 * Gerroald
 *  Thread Starter [Spiffy Plugins](https://wordpress.org/support/users/spiffyplugins/)
 * (@spiffyplugins)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/stream_set_timeout-error-filling-logs/#post-11697308)
 * Great, thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘stream_set_timeout error filling logs’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Spiffy Plugins](https://wordpress.org/support/users/spiffyplugins/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/stream_set_timeout-error-filling-logs/#post-11697308)
 * Status: resolved