undefined function trailingslashit() when .maintenance present
-
Looking for some ideas here.
Recently (I believe since the arrival of WP 6.1) if I am doing manual updates on any of the sites on my server, and place a .maintenance file in the site root, instead of getting the nice ‘under maintenance’ message they throw a 500 error like this…PHP Fatal error: Uncaught Error: Call to undefined function trailingslashit() in D:\HTTP\WP_Sites\Recipes\wp-includes\class-wp-textdomain-registry.php:103 Stack trace: #0 D:\HTTP\WP_Sites\Recipes\wp-includes\l10n.php(784): WP_Textdomain_Registry->set('default', 'en_AU', 'D:\\HTTP\\WP_Site...') #1 D:\HTTP\WP_Sites\Recipes\wp-includes\load.php(1401): load_textdomain('default', 'D:\\HTTP\\WP_Site...', 'en_AU') #2 D:\HTTP\WP_Sites\Recipes\wp-includes\load.php(278): wp_load_translations_early() #3 D:\HTTP\WP_Sites\Recipes\wp-settings.php(74): wp_maintenance() #4 D:\HTTP\WP_Sites\Recipes\wp-config.php(98): require_once('D:\\HTTP\\WP_Site...') #5 D:\HTTP\WP_Sites\Recipes\wp-load.php(50): require_once('D:\\HTTP\\WP_Site...') #6 D:\HTTP\WP_Sites\Recipes\wp-blog-header.php(13): require_once('D:\\HTTP\\WP_Site...') #7 D:\HTTP\WP_Sites\Recipes\index.php(17): require('D:\\HTTP\\WP_Site...') #8 {main} thrown in D:\HTTP\WP_Sites\Recipes\wp-includes\class-wp-textdomain-registry.php on line 103
I don’t have any issues with the sites in normal running, only when I put into maintenance mode.
NB my server is a Windows machine running PHP 7.4.19 and MySQL 5.7.21. I mention this as I believe it’s significant; the issue doesn’t occur if I put a .maintenance file onto one of the odd WP sites that I manage on a third party *nix server. My gut feel is that the way Windows uses \ in its path name rather than / in *nix is probably at the root of the issue.
Relevant bits of wp-config:
/** Absolute path to the WordPress directory. */ if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', __DIR__ . '/' ); } /** Sets up WordPress vars and included files. */ require_once ABSPATH . 'wp-settings.php'; /** Set the Temp Dir to a writable area within the site (defaults to c:\windows\tmp otherwise) */ define('WP_TEMP_DIR', ABSPATH . 'wp-content/tmp');
I will leave the site listed above in maintenance mode in case folks wish to view if for themselves (it’s a new site for a vanity project so no issue there).
Help???!!!
TIA,
GrahamThe page I need help with: [log in to see the link]
- The topic ‘undefined function trailingslashit() when .maintenance present’ is closed to new replies.