We have a wordpress installation on provider wpengine. When we try to update some plugins we get the fatal PHP error in subject. The provider support do not know how to help us. This is the call stack of the error:
"PHP Fatal error: Uncaught Error: Call to undefined function trailingslashit() in /nas/content/live/sillaindustrie/wp-includes/class-wp-textdomain-registry.php:103\nStack trace:\n#0 /nas/content/live/sillaindustrie/wp-includes/l10n.php(784): WP_Textdomain_Registry->set('default', 'it_IT', '/nas/content/li...')\n#1 /nas/content/live/sillaindustrie/wp-includes/load.php(1401): load_textdomain('default', '/nas/content/li...', 'it_IT')\n#2 /nas/content/live/sillaindustrie/wp-includes/load.php(278): wp_load_translations_early()\n#3 /nas/content/live/sillaindustrie/wp-settings.php(74): wp_maintenance()\n#4 /nas/content/live/sillaindustrie/wp-config.php(67): require_once('/nas/content/li...')\n#5 /nas/content/live/sillaindustrie/wp-load.php(50): require_once('/nas/content/li...')\n#6 /nas/content/live/sillaindustrie/wp-blog-header.php(13): require_once('/nas/content/li...')\n#7 /nas/content/live/sillaindustrie/index.php(17): require('/nas/content/li...')\n#8 {main}\n thrown in /nas/content/live/sillaindustrie/wp-includes/class-wp-textdomain-registry.php on line 103, referer: https://silla.industries/wp-admin/update-core.php?action=do-plugin-upgrade"
It seems to be related to WPML plugin or similar, any suggest?
Thanks
G.
I tried to update wordpress plugin, but I cannot understand the source of the error. Maybe it is plugins incompatibility but I don't know how to discover it.
As others have pointed out, this is an issue where wp-includes/formatting.php isn't available when the code in wp-includes/class-wp-textdomain-registry.php runs. It is an issue introduced by WordPress 6.1.
To work around this issue, you can change line 103 in wp-includes/class-wp-textdomain-registry.php from:
$this->all[ $domain ][ $locale ] = $path ? trailingslashit( $path ) : false;
To:
$this->all[ $domain ][ $locale ] = $path ? rtrim( $path, '/\\' ). '/' : false;
Update: I find the cause of the problem. WordPress 6.1 have made important updates to the WP_Textdomain_Registry object. This causes the error when the maintenance mode is activated during the plugin update process.
it is a bug in WP Core and will be fixed in 6.1.2
https://core.trac.wordpress.org/changeset/55010
Check you have installed php-psr.
I had this error as I hadn't installed php8.1-psr
Looks like the formatting.php functions are not available anymore when updating.
Update: I found a user that had a similar problem, he solved by deleting the wp_includes folder and then re-uploading it via FTP. I tried too: in staging environment it worked but in production the error still appears after updating any plugin :(
Update: I found a possible incompatibility with a TikTok plugin, but I'm not sure. In fact, after some updates that worked fine, the problem returned.
Got the same error several times since 6.1.x, I think on some servers this is just a timeout problem.
Have to compare some different instalations on different hosts.
And check if there ist still the .maintenance in your WP dir.
I am new in symfony framework. Getting the below error when download the full project in localhost but it works in server.
Fatal error: Class 'Symfony\Bridge\Doctrine\ManagerRegistry' not found
in D:\wamp\www\DOFE\edin\vendor\doctrine\doctrine-bundle\Registry.php
on line 28
Thanks in advance.
You probably want to execute composer dump-autoload to force composer to regenerate the autoload namespaces for your app.
Regarding your comment, if you are getting this message it means you are in prod and you should switch to the dev environment to have details about the error (access to the symfony profiler).
Just add app_dev.php after the host in the url.
I need to move app in laravel from web server to local sever (I trying on XAMPP). I moved all files, database and in files I changed URI in:
/index.php
<? header("Location: http://localhost/public"); ?>
but I get errors in:
On http://localhost/ I have blank page
On http://localhost/public and every another route I getting error: http://pastebin.com/zUFqS8ET
When I use php artisan or another commands I getting error:
[ErrorException]
Undefined index: HTTP_USER_AGENT
I forgot about somethink?
EDIT:
Ok, I downgrade my PHP to 5.6.* but artisan still not working - same error, what's the problem?
EDIT 2:
Here is logs - problem is in SMF but I don't know why ...
http://pastebin.com/HZQ7CZeg
Sorry, I know this is obvious. But, have you run PHP composer install? And as a basic test you can create an empty laravel project to test your computer's configuration. If it works then you know its something in your project you need to update.
Laravel installation
i wonder why i'm get something like this when add pingpong sky module to project
i think, i already follow all instruction in pingpong sky installation
when i create module Auth in cmd i got message success
but when i try to access Auth module in browser by this url
http://localhost/skypp/public/auth
i got message error
FatalErrorException in Application.php line 575:
Class 'Modules\Auth\Providers\AuthServiceProvider' not found
i think some problem occur when create that module
so i tried again make new module,
but it's failed this time like in pict
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Modules\Auth\Providers\AuthServiceProvider' not found
where i'm missing?
It's actually quite simple and I don't know why the module:make command doesn't integrate it...
Please run a composer dump-autoload so that it rescans the PSR-4 folder and you should be good to go :)
I just pulled in the latest version of Codeception using Composer and ran vendor/bin/codecept bootstrap and received the error when it tried to the Build Inital Guy Classes:
PHP InvalidArgumentException: Given expression is not a regex. In:
vendor/symfony/finder/Symfony/Component/Finder/Expression/Regex.php on line 77
It actually does seem to complete, but whenever I run vendor/bin/codecept run I also get this same error.
For reference i'm using:
Laravel Latest
Composter Latest
PHP 5.4.25
Thanks for the assistance.
As a workaround, you can disable xdebug for php5-cli.