Drupal - Fatal error sessionhandler - php

I am receiving following errors when I try to access pages and the site becomes inaccessible(error 500).
PHP Fatal error: Class Drupal\Core\Database\Statement contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Database\StatementInterface::fetchObject) in /projects/core/lib/Drupal/Core/Database/Statement.php on line 16
PHP Fatal error: Class Drupal\Core\Session\SessionHandler contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in /projects/core/lib/Drupal/Core/Session/SessionHandler.php on line 15
Restarting server will solve the issue for a limited time. Just found it was a memory issue. changed the memory_limit to 128, 256 and 512 but really seems to have happen randomly while browsing my website
Apache/2.4.29, PHP 7.0.26

Hey just need to delete cache or run drupal cron. for more details, please go to following the link.
https://www.drupal.org/project/drupal/issues/2668564
Hope it will useful for you.

Related

CodeIgniter Database Session Error

When I try to execute any controller of my CodeIgniter project i receive this error:
Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in D:\Git\crud-farm\system\libraries\Session\drivers\Session_files_driver.php on line 49
A PHP Error was encountered
Severity: Error
Message: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read)
Filename: drivers/Session_files_driver.php
Line Number: 49
Backtrace:
I tried to replace CodeIgniter system files but it didn't work. The problem appears in all projects
Problem solved by restarting Apache.
I attach the url which saved me: http://forum.codeigniter.com/thread-64763.html
In my case i did the following
Restart apache
That's it!
The files in system should not be modified. My files were modified somehow and were throwing error. I resolved my problem as below.
Download fresh codeigniter and extract files
copy system files from fresh codeigniter into your project and overwrite the whole system folder.
This should fix your problem.

Fatal Magento error fix generated after restore

My web host restored my magento installation after crash and since then I get error:
Fatal error: Class Magento_Db_Adapter_Pdo_Mysql contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Varien_Db_Adapter_Interface::insertIgnore, Varien_Db_Adapter_Interface::changeTableAutoIncrement) in /lib/Magento/Db/Adapter/Pdo/Mysql.php on line 35
How do I fix it?

Fatal error: Undefined class constant 'FORM_KEY' -- Magento

After upgrading from Magento ver. 1.7.0.2 to 1.9.2.0 I've run intop a error and can't find a solution anywhere.
The error is:
Fatal error: Undefined class constant 'FORM_KEY' in \app\code\core\Mage\Checkout\Helper\Cart.php on line 67
No other errors in system.log, exception.log or php error.log. Just this error printout on the page.
How can I fix this?
The class constant is Mage_Core_Model_Url::FORM_KEY and did not exist yet in Magento 1.7
If you use the Magento compiler active (you shouldn't, see: when should I use the Magento compiler), recompile. If you use an opcode cache like APC, flush it.
But most likely the issue is that you made a copy of this class in app/code/local/Mage/Core/Model/Url.php to hack some changes into it. Check what you changed there, replace it with the new file from app/code/core/Mage/Core/Model/Url.php and re-apply your changes1.
1. Even better, don't put anything in app/code/local/Mage and user proper class rewriting

Drupal failed after update

I just updated Drupal core from 7.4 to 7.26. After running update.php site stopped working – both public and admin part. When I load it fatal error occurs:
Fatal error: Call to undefined function _system_default_theme_features() in /[drupal_path]/includes/theme.inc on line 1422
and when I reload it another fatal error apperars:
Fatal error: Call to a member function getDirectoryPath() on a non-object in /[drupal_path]/modules/image/image.module on line 83
next reload – first error, one more – second. Also, second error is loading much faster.
And one more thing, after applaying update.php I got one failed, I don't know if this is connected:
media_gallery module
Update #7009
Failed: FieldException: Próba aktualizacji egzemplarza nieistniejącego pola media_gallery_media. w field_update_instance() (linia 557 z /[drupal_path]/modules/field/field.crud.inc).
which is something like:
Failed: FieldException: Attempt to update an instance of a nonexistent field media_gallery_media. in field_update_instance() (line 557 in /[drupal_path]/modules/field/field.crud.inc).
PHP Version 5.5.6
Any tips where the problem is? I was trying disabling some modules from db, but this did't help.
It's difficult to explain the reason and to provide a solution.
My attempt would be to copy the DB and the files on a neutral platform (local machine or so) and experiment with the update.php script.
My suspicion would be that media module needs also update since it's using the old URI function definition (call). Also try to update other modules that are working with files.
The update is quite big since 7.4 to 7.22 (years of improvement). Reading the change log would be helpful but not realistic.
Did you also cleared the cache? (via drush if the web interface not working - /?q=admin/config/development/performance)
Please don't forget to post the solution if you find one for other users with the same issue.

PHP + APC + Zend: Classes cannot be found

I can't get APC to work properly with my Zend+Doctrine application. When I turn APC on I get the error:
Fatal error: Access to undeclared static property: Zend_Loader_Autoloader::$_instance in /var/www/libs/Zend/Loader/Autoloader.php on line 92
I've seen lots of people complaining about that but no one seem to have solved their problem, except by this guy: Access to undeclared static property: Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver::
I tried that aproach, upgrading APC from 3.1.3 to 3.1.9. It didn't work for me.
I tried enabling nclude_once_override:
apc.include_once_override = 1
Didn't work either.
I also tried to get APC not to cache Zend_Loader_Autoloader by addint the following line to apc.ini:
apc.filters = Autoloader.php
It solved the primary problem, but caused another one:
Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Zend_Loader' not found in /var/www/libs/Zend/Loader/Autoloader.php on line 472 Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Zend_Loader' not found in /var/www/libs/Zend/Loader/Autoloader.php on line 472 Fatal error: Class 'Doctrine_Event' not found in /var/www/libs/Doctrine/Record.php on line 801
Next thing I did was get APC not to cache Zend_Loader
apc.filters = Autoloader.php,Loader.php
Solves the problem above, but other classes can't be found:
Fatal error: Class 'Zend_Exception' not found in /var/www/libs/Zend/Loader.php on line 99
I got APC not to cache Zend_Exception, but other classes won't be found.
Note that the errors occur only from the 2nd time the page loads on, after the cache is cleared. First page load works like a charm.
Anyone faced a similar problem and was able to solve it?
Thank you very much.
You need session_write_close():
\Zend_Session::setSaveHandler($foo);
register_shutdown_function('session_write_close');

Categories