Solution for Fatal error: Class Magento\Framework\Session\SaveHandler contains 1 abstract method in magento2:

There is a chances to get the following error while after successful installation of magento2.2.x above version.
Error:
Fatal error: Class Magento\Framework\Session\SaveHandler contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::open) in lib\internal\Magento\Framework\Session\SaveHandler.php on line 16 in magento2

Solution:
we have to replace the code as like below from SaveHandlerInterface.php

From
interface SaveHandlerInterface extends \SessionHandlerInterface
Replace with
interface SaveHandlerInterface extends \Zend_Session_SaveHandler_Interface

Above Magento2.2.x version:
If you installed magento2.2.x (with composer) then edit the file from following path,
root\lib\internal\Magento\Framework\Session\SaveHandlerInterface.php
When you install magento2.2.x with composer you may get only following 3 folders, so here you will not get
1. composer
2. magento-composer-installer
3. zendframework1
In this version you have to edit the code from the respective file.

Less than magento2.2.x version
It depend on the magento2 version which you have installed.
Ex: If you installed less than magento2.1.x by default above code has been replaced by magento team. Go and see the file from vendor\magento\framework\Session\SaveHandlerInterface.php

 

CORNER OF BLOG:

“SAVE WATER”

Leave a Reply