Hello,
After updating from 2.4.0 to 2.4.1 I get the following error when loading frontend (top error) or backend (bottom error):
[2020-11-02 03:22:02] main.CRITICAL: Type Error occurred when creating object: Magento\Framework\Session\Generic\Interceptor, setcookie() expects parameter 3 to be integer, array given {"report_id":"b5208b4e885ad1c8c5a621d03aac36c3b5aba22dd68a52eab6229ed5c151be90","exception":"[object] (Magento\\Framework\\Exception\\RuntimeException(code: 0): Type Error occurred when creating object: Magento\\Framework\\Session\\Generic\\Interceptor, setcookie() expects parameter 3 to be integer, array given at /home/frogsnth/dev.frogsnthings.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:131)"} [] [2020-11-02 03:23:52] main.CRITICAL: Type Error occurred when creating object: Magento\Backend\Model\Auth\Session\Interceptor, setcookie() expects parameter 3 to be integer, array given {"report_id":"9dc371945d6af583457ba608d56122249afd6fbe94f9b55ee02876eb6484700a","exception":"[object] (Magento\\Framework\\Exception\\RuntimeException(code: 0): Type Error occurred when creating object: Magento\\Backend\\Model\\Auth\\Session\\Interceptor, setcookie() expects parameter 3 to be integer, array given at /home/frogsnth/dev.frogsnthings.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:131)"} []
Base installation, no extensions, running php ea7.3.
I'd appreciate any suggestions you might have. Thanks,
Keith
Solved! Go to Solution.
@kqt377 kindly check PHP version with PHP info file in the webroot.
<?php phpinfo(); ?>
As it seems like your PHP version is 7.2.
after updating the PHP version you need to remove files in the generated folder.
rm -rf generated/code/ var/view_preprocessed/ var/page_cache
You also need to confirm PHP version in the command line as it's possible that PHP version in the command line and website may be different.
php -v
if that is 7.2 than you need to check how you can run php7.3 command line with your system admin.
to check that you can type php and hit tab key twice.
if that is php7.3 than you need to run Magento command as
php7.3 bin/magento cache:clean
Hi @kqt377
The interceptor file needs to be re-create. So kindly run below commands:
php bin/magento setup:di:compile php bin/magento cache:clean
It may help you!
Problem solved? Please click on 'Kudos' & Accept as Solution!
@kqt377 kindly check PHP version with PHP info file in the webroot.
<?php phpinfo(); ?>
As it seems like your PHP version is 7.2.
after updating the PHP version you need to remove files in the generated folder.
rm -rf generated/code/ var/view_preprocessed/ var/page_cache
You also need to confirm PHP version in the command line as it's possible that PHP version in the command line and website may be different.
php -v
if that is 7.2 than you need to check how you can run php7.3 command line with your system admin.
to check that you can type php and hit tab key twice.
if that is php7.3 than you need to run Magento command as
php7.3 bin/magento cache:clean
@amitsamsukha Thank you so much for the reply. I have cleared the generated/code folder, var folder, flushed cache, re-compiled, reindexed each to no avail. CLI is PHP 7.3.21. Composer was run using 7.3 as well.
Can you clarify how to "check PHP version with PHP info file in the webroot"? I do not see such a file and cant run in cli:
<?php phpinfo(); ?>
Sorry if a dumb question. Appreciate the help. Keith
to check in webroot you just need to create a file : phpinfo.php
and put the code in that file
<?php phpinfo(); ?>
and run that file in browser
http://yourdomain.com/phpinfo.php
it should print all information regarding PHP and extensions
@amitsamsukha Ah, now I understand Thank you!
Bingo! dev.frogsnthings.com/phpinfo.php returns version 7.1!
How do I update this?
I have updated multiPHPmanager to 7.3 on my root and sub domains in cpanel previously.
Thanks again for the help,
Keith
@kqt377 ,
kindly follow https://www.inmotionhosting.com/support/edu/cpanel/how-to-change-the-php-version-your-account-uses/
and update the PHP version to 7.3
also, change your default PHP version to 7.3 that will help
kindly Accept as Solution if this works for you and give Kudos
Thank you. I've updated MultiPHP Manager to 7.3 before upgrade, so that's not it. Contacted my host re default version....
Thank you @amitsamsukha so much. I informed host and they update default. Site is working now!
For completeness on the solution:
Added the following code in the .htaccess file of the website to force the website to use PHP7.3
AddHandler application/x-httpd-php73 .php