Title: Getting fsockopen error in wordpress 2.8
Last modified: August 19, 2016

---

# Getting fsockopen error in wordpress 2.8

 *  [ghankit](https://wordpress.org/support/users/ghankit/)
 * (@ghankit)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/getting-fsockopen-error-in-wordpress-28/)
 * I am getting this error in wordpress while placing any text widget or inserting
   ant php code in widget .
 * Warning: fsockopen() has been disabled for security reasons in /www/vndv.com/
   u/b/e/ubertech/htdocs/wp-includes/class-snoopy.php on line 1142
 * can you mark out the error !!

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

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/getting-fsockopen-error-in-wordpress-28/#post-1173998)
 * only your host can allow this action – speak with them
 *  [Dave333](https://wordpress.org/support/users/dave333/)
 * (@dave333)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/getting-fsockopen-error-in-wordpress-28/#post-1174302)
 * Yes, this is a pain. it means your host has probably decided it is a security
   threat and turned it off.
 * At least that is what my host has told me.
 * This is what they suggested:
 *  We have disabled allow_url_fopen  php configuration  on the server due to its
   hacking vulnerabilities, very few applications require it, and by disabling it
   we  will prevent exploitation of PHP remote include vulnerabilities.
 * Applications that do require it can be modified to use cURL instead.
 * Please contact your developer and modify the code in your filename.php as follows.
 * Instead of:
 *  $file_contents = file_get_contents(‘[http://example.com/](http://example.com/)‘);
   //
   display file echo $file_contents; ?>
 * Use this:
 *  $ch = curl_init();
    $timeout = 5; // set to zero for no timeout curl_setopt (
   $ch, CURLOPT_URL, ‘[http://example.com](http://example.com) ‘); curl_setopt (
   $ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
   $file_contents = curl_exec($ch); curl_close($ch); // display file echo $file_contents;?
   >
 * If anyone knows what that means and on which file to make these changes please
   post here.

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

The topic ‘Getting fsockopen error in wordpress 2.8’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Dave333](https://wordpress.org/support/users/dave333/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/getting-fsockopen-error-in-wordpress-28/#post-1174302)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
