ErrorHandler issue Migrating from PHP 5.5 to 7 - php

I'm working on migrating from Ubuntu 14 to 16 and php 5.5 to 7. When I'm trying to turn on my application, I keep running into an ErrorHandler Fatal Error. Does anyone know a quick way to resolve this?
ubuntu#dev2:/var/www/xyz$ php app/console
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ErrorHandler::handleException() must be an instance of Exception, instance of Error given in /var/www/xyz/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:436
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ErrorHandler->handleException(Object(Error))
#1 {main}
thrown in /var/www/xyz/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php on line 436

Related

How to solve GuzzleHttp redeclare error in Yii PHP?

When I run my PHP Yii framework file, It results in the following error.
PHP Compile Error 'yii\base\ErrorException' with message 'Cannot redeclare GuzzleHttp\Psr7\str() (previously declared in /Applications/XAMPP/xamppfiles/htdocs/PLATO/framework/vendor/guzzlehttp/psr7/src/functions.php:19)' in /Applications/XAMPP/xamppfiles/htdocs/PLATO/protected/extensions/aws/GuzzleHttp/Psr7/functions.php:18 Stack trace: #0 [internal function]: yii\base\ErrorHandler->handleFatalError() #1 {main}
How to fix this issue?

Error in single php line : Parse error: /wp-includes/option.php wp_cache_add

The website randomly went down and I can't figure out how to correct the following error. I have tried toggling all plugins, the server was recently updated to PHP 7.4 from PHP 7.3 but no other website has had this issue.
My Setup:
PHP - PHP 7.4.11 (cli) (built: Oct 8 2020 17:32:43)
uname - Debian 4.19.146-1 (2020-09-17) x86_64 GNU/Linux
MySQL - mysql Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Error from the website:
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/functions.php(1717): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/load.php(664): is_blog_installed() #2
/WEBSITE_PATH/wp-settings.php(159): wp_not_installed() #3
/WEBSITE_PATH/wp-config.php(99): require_once('/home/swcsoldie...') #4
/WEBSITE_PATH/wp-load.php(37): require_once('/home/swcsoldie...') #5
/WEBSITE_PATH/wp-blog-header.php(13):
require_once('/home/swcsoldie...') #6 /WEBSITE_PATH/index.php(22):
require('/home/swcsoldie...') #7 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/option.php(116): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/l10n.php(69): get_option() #2
/WEBSITE_PATH/wp-includes/l10n.php(137): get_locale() #3
/WEBSITE_PATH/wp-includes/l10n.php(828): determine_locale() #4
/WEBSITE_PATH/wp-includes/class-wp-fatal-error-handler.php(46):
load_default_textdomain() #5 [internal function]:
WP_Fatal_Error_Handler->handle() #6 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Code from Line 258:
wp_cache_add( 'alloptions', $alloptions, 'options' );
An undefined function error in PHP is fatal error, and means you're calling a function that doesn't exist (at least, at the point and scope it's being called at). Most often, I'd wager 9/10 times, this happens while you're developing and you mistype a function name, str_repace instead of str_replace, for instance.
With all of that being said, wp_cache_add() is a WordPress Core function defined in /wp-includes/cache.php, and is being called by a core file: /wp-includes/option.php on line 258.
Since these core files, and core functions are triggering a fatal "undefined function" error, it means your WordPress installation is failing somewhere. It possibly got corrupted during an update of some kind - it's infrequent, but it does happen for any number of reasons.
To fix this: try reinstalling WordPress, as it is absolutely compatible with PHP 7.4.

Joomla & PHP 7 : Fatal error: Argument 1 passed to JErrorPage::render()

Got the following error when I try to update a Joomla 3.9 website on a PHP7.2 environement.
Fatal error: Uncaught TypeError: Argument 1 passed to JErrorPage::render() must be an instance of Exception, instance of Error given in /var/www/xxxxx/libraries/cms/error/page.php:28 Stack trace: #0 [internal function]: JErrorPage::render(Object(Error)) #1 {main} thrown in /var/www/xxxxx/libraries/cms/error/page.php on line 28
Any idea what could cause this?
Website works fine on PHP 5.6 but I can't switch to PHP 7.2

Lumen 5.3 & PHP 7: Symfony Error ExceptionHandler

We have a project that uses Lumen 5.3, however when we always install PHP7 on the server it gives this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ExceptionHandler::handle() must be an instance of Exception, instance of Error given in /var/www/retail-api/vendor/symfony/symfony/src/Symfony/Component/Debug/Excepti
onHandler.php:105
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ExceptionHandler->handle(Object(Error))
#1 {main}
thrown
When we revert it back to PHP5.6 it works. Based on my research this was supposed to be fixed in Symfony > 2.6 is this correct? If so why is this happening on our environment. Most of our Laravel projects are already using PHP7. This, however is an exception, is there something that I am missing?

Laravel 5.1 Composer install error

When running composer install I get the following error:
php artisan clear-compiled
PHP Fatal error: Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of Error given, called in /home/vagrant/Code/courtesy-sys/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /home/vagrant/Code/courtesy-sys/app/Exceptions/Handler.php:25
Stack trace:
#0 /home/vagrant/Code/courtesy-sys/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): App\Exceptions\Handler->report(Object(Error))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Error))
#2 {main}
thrown in /home/vagrant/Code/courtesy-sys/app/Exceptions/Handler.php on line 25
[Symfony\Component\Debug\Exception\FatalErrorException]
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of Error given, called in /home/vagrant/Code/courtesy-sys/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /home/vagrant/Code/courtesy-sys/app/Exceptions/Handler.php:25
Stack trace:
#0 /home/vagrant/Code/courtesy-sys/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): App\Exceptions\Handler->report(Object(Error))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Error))
#2 {main}
thrown
Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255
Is there someone with a similar problem and can provide me with the solution. I tried Google without any results...
Try it:
composer install --no-scripts

Categories