500 error - Fatal e...
 
Notifications
Clear all

wpForo 1.x.x [Solved] 500 error - Fatal error: Uncaught TypeError: fclose()

3 Posts
2 Users
0 Reactions
3,306 Views
Posts: 16
Topic starter
(@tonyatfonsori)
Eminent Member
Joined: 4 years ago

Fatal error: Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, bool given in /www/######/public/wp-content/plugins/wpforo/wpf-includes/functions.php:847 Stack trace: #0 /www/######/public/wp-content/plugins/wpforo/wpf-includes/functions.php(847): fclose(false) #1 /www/######/public/wp-content/plugins/wpforo/wpf-includes/functions.php(1129): wpforo_get_file_content('/www/######...') #2 /www/######/public/wp-content/plugins/wpforo/wpforo.php(555): get_wpf_option('wpforo_use_home...', 0) #3 /www/######/public/wp-content/plugins/wpforo/wpforo.php(125): wpForo->init_options() #4 /www/######/public/wp-content/plugins/wpforo/wpforo.php(109): wpForo->__construct() #5 /www/######/public/wp-content/plugins/wpforo/wpforo.php(1119): wpForo::instance() #6 /www/######/public/wp-content/plugins/wpforo/wpforo.php(1124): WPF() #7 /www/######/public/wp-settings.php(388): include_once('/www/######...') #8 /www/######/public/wp-config.php(80): require_once('/www/######...') #9 /www/######/public/wp-load.php(37): require_once('/www/######...') #10 /www/######/public/wp-blog-header.php(13): require_once('/www/######...') #11 /www/Fatal error: Uncaught TypeError: fclose()/public/index.php(17): require('/www/######...') #12 {main} thrown in /www/######/public/wp-content/plugins/wpforo/wpf-includes/functions.php on line 847

2 Replies
Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi @tonyatfonsori,

Something is wrong with your server file system permissions. Please change and make sure all folders have 755 permission, and all files have 644 permission. Folders and files I recommend to check:

  • /wp-content/
  • /wp-content/uploads/
  • /wp-content/uploads/wpforo/
  • /wp-content/uploads/wpforo/cache/

 

We'll adapt the core to avoid such error in next update. At the moment you can do a small change in wp-content/plugins/wpforo/wpf-includes/functions.php file. Please open this file and find this code part:

if( !$fp ){
@fclose( $fp );
return false;
}

 

Remove the @fclose( $fp ); line:

if( !$fp ){
return false;
}

 

Save and activate the plugin again.

Posts: 16
Topic starter
(@tonyatfonsori)
Eminent Member
Joined: 4 years ago

Hi Robert, thanks for the help. I got it to work following your advice.