Latest reliable PHP version?
-
What’s the latest version of PHP that bbPress can reliably run on?
The most recent update says it improved PHP 8.2 support, but it crashes on the dev site I’m running that is on 8.2.29. Is there an earlier version that is known to work well?
Also, does anyone know what the developers’ plans are for PHP versions beyond 8.2? I was hoping to upgrade our sites to 8.4, but bbPress is the limiting factor on a couple of them.
-
I am running 8.3 on my test site with no issues for many months now, and have just updated it to 8.4 and looks ok, but obviously not tested every function.
When you say it crashes, what error message are you getting?
When I try to access a forum, I only see the site header (the rest of the page is blank). This is what shows up in my debug.log:
[07-Aug-2025 22:39:33 UTC] PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/[SITEURL]/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173 [07-Aug-2025 22:39:34 UTC] PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/[SITEURL]/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173 [07-Aug-2025 22:39:39 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/[SITEURL]/httpdocs/wp-content/themes/Avada/includes/class-avada-layout-bbpress.php on line 219 [07-Aug-2025 22:39:39 UTC] PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/[SITEURL]/httpdocs/wp-content/themes/Avada/includes/class-avada-layout-bbpress.php on line 219 [07-Aug-2025 22:39:39 UTC] PHP Fatal error: Uncaught Error: Undefined constant "description" in /var/www/vhosts/[SITEURL]/httpdocs/wp-content/themes/Avada-Child-Theme/bbpress.php:22 Stack trace: #0 /var/www/vhosts/[SITEURL]/httpdocs/wp-includes/template-loader.php(106): include() #1 /var/www/vhosts/[SITEURL]/httpdocs/wp-blog-header.php(19): require_once('/var/www/vhosts...') #2 /var/www/vhosts/[SITEURL]/httpdocs/index.php(17): require('/var/www/vhosts...') #3 {main} thrown in /var/www/vhosts/[SITEURL]/httpdocs/wp-content/themes/Avada-Child-Theme/bbpress.php on line 22 [07-Aug-2025 22:39:39 UTC] PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/[SITEURL]/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173 [07-Aug-2025 22:39:47 UTC] PHP Warning: chmod(): Operation not permitted in /var/www/vhosts/[SITEURL]/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 173
The above is with this in wp-config.php:
define('FS_METHOD', 'direct');
Our sites are normally set to
define('FS_METHOD', 'ftpext');
but that produces a much longer error string in the log and a “this site has experienced a critical error” message in the browser.Our prod site is on PHP 7.4.33 and doesn’t have any issues in either FS_METHOD mode. Did PHP 8 change something that affected filesystem access?
Notes:
– This is a multisite with a bbPress forum on almost all sites.
– Our theme, Avada, runs fine on our other dev site with PHP 8.4.ok the fatal error is
[07-Aug-2025 22:39:39 UTC] PHP Fatal error: Uncaught Error: Undefined constant "description" in /var/www/vhosts/[SITEURL]/httpdocs/wp-content/themes/Avada-Child-Theme/bbpress.php:22
so this is a file called bbpress.php which sites in you child theme.
I suspect that this is a file that contains amendments to bbpress that someone has made, but without knowing why that file is there and what it does, I cannot say further
Thank you for helping me interpret that!
This is what was on that line:
<p class="logo_tagline"><?php bloginfo(description); ?></p>
I added single quotes to
'description'
and now the forums fully load (whenFS_METHOD
is set todirect
). That line was basically the only difference between the original bbpress.php and the child theme’s copy of bbpress.php.Unfortunately, that fix only works with
FS_METHOD
set todirect
. I need it set toftpext
so WordPress requests FTP credentials (for things like plugin updates), because otherwise WP doesn’t have write permission.When I change
FS_METHOD
toftpext
, the forum pages start giving me the ol’ “There has been a critical error on this website” message.
The log gives me this:
[08-Aug-2025 17:23:55 UTC] PHP Fatal error: Uncaught TypeError: ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /var/www/vhosts/[SITEURL]/httpdocs/wp-admin/includes/class-wp-filesystem-ftpext.php:146
That’s not a bbPress file, so I think I’ll have to talk with our webhost about this.
Thanks for your help!
can you post the whole function that the line is part of? I might be able to help further – or not – I can’t promise 🙂
Sure!
/** * Reads entire file into a string. * * @since 2.5.0 * * @param string $file Name of the file to read. * @return string|false Read data on success, false if no temporary file could be opened, * or if the file couldn't be retrieved. */ public function get_contents( $file ) { $tempfile = wp_tempnam( $file ); $temphandle = fopen( $tempfile, 'w+' ); if ( ! $temphandle ) { unlink( $tempfile ); return false; } if ( ! ftp_fget( $this->link, $temphandle, $file, FTP_BINARY ) ) { fclose( $temphandle ); unlink( $tempfile ); return false; } fseek( $temphandle, 0 ); // Skip back to the start of the file being written to. $contents = ''; while ( ! feof( $temphandle ) ) { $contents .= fread( $temphandle, 8 * KB_IN_BYTES ); } fclose( $temphandle ); unlink( $tempfile ); return $contents; }
Line 146 is
if ( ! ftp_fget( $this->link, $temphandle, $file, FTP_BINARY ) ) {
ok, thanks.
Given that the file is now ‘redundant’ in the child theme (as it is now the same as bbpress), are you able to remove both that whole file and the call to it – presumably in the child theme functions file.
It may be that calling it as part of a theme rather than plugin is affecting how bbpress works at that point – but I am just guessing at possible issues
- You must be logged in to reply to this topic.