The website does not work properly after changing PHP
-
I can’t upgrade PHP to 8.2. My ISP says it’s related to the theme not being compatible with a higher version of PHP. The theme is updated, but I don’t have much time to update PHP – I have to do it within 7 days. I am asking for help in this matter.
-
Hello @aptsosna,
OceanWP theme and our plugins have fully compatibility with PHP 8.2.
Also, we have not received any similar reports so far.
What is the incompatibility message you got from your server provider? Or what is the issue after changing the PHP version?Please explain it, including screenshots, URLs, and any other document, so we can understand and check it better. You can upload your files to one of the following online services:
https://postimages.org
https://loom.com
https://drive.google.com
https://wetransfer.com
Or any other service you know.Best Regards
Same thing happened to me. I was setting up a brand new site on PHP 8.0, everything was working fine until I installed OceanWP theme. As soon as I did I got an error:
“There has been a critical error on this website. Please check your site admin email inbox for instructions.
Learn more about troubleshooting WordPress.”
Doesn’t work with 8.2, 8.1 or 8.0. As soon as I switch to 7.4 everything works fine.
I’ve tried other themes and they had no problem. I also don’t have any plugins activated. The only change from the base installation of WordPress has been OceanWP.
Hello @macsuibhne,
The message says: “There has been a critical error on this website. Please check your site admin email inbox for instructions.”
Did you check the site admin email inbox? Please share the message of the error here.
That message shows a general message.
Please check the super administrator email to see the error or which plugins cause the issue. The error message will always be sent to the super administrator email in WordPress.There is another way to see the error: you need to turn on the WordPress debugger mode. To enable it. Please follow the steps explained in this link: https://ww.wp.xz.cn/documentation/article/debugging-in-wordpress/
After finding the error, please share the error message here, and we’ll check it.
Best Regards
I switched to PHP 8.0 and the site immediatly breaks.
There are no active plugins.
OceanWP is the only change to the base WordPress installation. Not a child theme.
Doesn’t happen with any of the default themes.[15-Nov-2023 19:29:37 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 2621440 bytes) in /home/urnplates/public_html/wp-admin/includes/template.php on line 1316
[15-Nov-2023 19:30:47 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 2621440 bytes) in /home/urnplates/public_html/wp-admin/includes/template.php on line 1270
[15-Nov-2023 19:30:49 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 2621440 bytes) in /home/urnplates/public_html/wp-admin/includes/template.php on line 1270
The line at 1270 is:
$filename = preg_replace( ‘|^/([^/]/).$|’, ‘\1’, $filename );The entire section of code is:
/**
- Internal helper function to find the plugin from a meta box callback.
* - @since 5.0.0
* - @access private
* - @param callable $callback The callback function to check.
- @return array|null The plugin that the callback belongs to, or null if it doesn’t belong to a plugin.
*/
function _get_plugin_from_callback( $callback ) {
try {
if ( is_array( $callback ) ) {
$reflection = new ReflectionMethod( $callback[0], $callback[1] );
} elseif ( is_string( $callback ) && str_contains( $callback, ‘::’ ) ) {
$reflection = new ReflectionMethod( $callback );
} else {
$reflection = new ReflectionFunction( $callback );
}
} catch ( ReflectionException $exception ) {
// We could not properly reflect on the callable, so we abort here.
return null;
} // Don’t show an error if it’s an internal PHP function.
if ( ! $reflection->isInternal() ) {// Only show errors if the meta box was registered by a plugin. $filename = wp_normalize_path( $reflection->getFileName() ); $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR ); if ( str_starts_with( $filename, $plugin_dir ) ) { $filename = str_replace( $plugin_dir, '', $filename ); $filename = preg_replace( '|^/([^/]*/).*$|', '\\1', $filename );$plugins = get_plugins(); foreach ( $plugins as $name => $plugin ) { if ( str_starts_with( $name, $filename ) ) { return $plugin; } }}} return null;
}
Hello @macsuibhne,
This is the “Allowed memory size“, a known problem related to the host/server configuration and resource consumption.
In this case, you must increase the “memory_limit” size by editing the wp-config.php file. To edit the wp-config.php file, please follow the steps explained in this link: https://developer.ww.wp.xz.cn/apis/wp-config-php/#increasing-memory-allocated-to-php.
Host configurations:
To access these fields, please edit the “php.ini”, file, which is located in the host (if you can’t find it, then contact your host service provider)upload_max_filesize = 32M
post_max_size = 48M
memory_limit = 512M
max_execution_time = 800
max_input_vars = 10000
max_input_time = 900WordPress Configurations:
Reference: https://ww.wp.xz.cn/about/requirements/I hope it helps.
Best Regards - Internal helper function to find the plugin from a meta box callback.
The topic ‘The website does not work properly after changing PHP’ is closed to new replies.
