 
	
		
		
		
		
			
- 
		AuthorPosts
- 
		
			
				
August 23, 2025 at 1:16 am #1488431Rob Marlbrough GuestMy client using Enfold is on PHP 8.3, after updating Enfold the site died with a fatal error: Got error ‘PHP message: PHP Fatal error: Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /var/www/vhosts/domain.com/httpdocs/wp-content/themes/enfold/framework/php/function-set-avia-backend.php:1012 That line is: 
 $filecontent = fread( $handle, $fsize );The error happens because in PHP 8.3, fread() now throws a ValueError if you pass a length of 0 or negative. In PHP 8.2 it would just return an empty string silently. It should be changed to: 
 $filecontent = $fsize > 0 ? fread($handle, $fsize) : ”;For now I just switched the client to PHP 8.2, and that was a quick fix. Please patch it so that others using PHP 8.3 don’t break their sites. August 23, 2025 at 10:07 am #1488435Hey Rob, We are running PHP 8.4 on several test installations without any problems, are you sure that you are running the latest version of the theme? Best regards, 
 RikardAugust 23, 2025 at 10:18 pm #1488457Yes it was the latest… but it also is not happening on other sites, so it may be conditional on what that function is doing, if the length of a file is zero it will error, but what causes it to be zero? The error will occur in 8.3 only if the length is zero or null, I guess. August 24, 2025 at 11:06 am #1488459Hi, Thanks for the update. Is there a way that we could reproduce this error on our installations? Best regards, 
 RikardAugust 24, 2025 at 7:16 pm #1488468I am not sure what that function does or is for, and why a file length would be zero? I am not sure how to reproduce it. August 24, 2025 at 7:17 pm #1488469Probably best to just update that line so it handles zero values as mentioned. August 25, 2025 at 2:54 pm #1488492
- 
		AuthorPosts
- You must be logged in to reply to this topic.
