CodeIgniter Database Session Error - php

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.

Related

include a class from a different website in laravel new project

I am working on a backend api using laravel 5.6
Already have a website with tons of code - all the answers I found point at create a new folder and adding my classes there that is not an option.
I would like to include the class from the main site (same server) and use the methods within laravel to generate the data from the api.
Route::get('api/author/full/', array('uses' => 'AuthorController#getAuthor'));
I am using this line to include my class:
require_once('/var/www/html/modules/author/models/Author.class.php');
laravel is located in a subfolder at /var/www/html/api/
this is the error I get when i try to require that file from within the AuthorController :
Fatal error: Call to undefined method ErrorException::getStatusCode() in /html/api/app/Exceptions/Handler.php on line 61
Fatal error: Call to undefined method Symfony\Component\Debug\Exception\FatalErrorException::getStatusCode() in /html/api/app/Exceptions/Handler.php on line 61
really tried everything here,included it in public/index.php and in other places and none of these things worked.

Drupal - Fatal error sessionhandler

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.

How to detect which file error in Lavel 5

I'm learing laravel 5. A day, when I run php artisan command I got this error
Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in C:\xampp\htdocs\premiumlens\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 62 and defined in C:\xampp\htdocs\premiumlens\vendor\laravel\framework\src\Illuminate\Routing\UrlGenerator.php on line 102
Almost application functions work perfect. But may not all. I'm sure the error is not caused by UrlGenerator.php
Now I cant use any artisan functions. How can I detect which file cause this issue.
Thank you !
I think you used url() helper in your config file, find where you put url() helper in your config file and remove it. your problem will be solved. i had this same problem and solved by removing url() form config file..
url('bassets/plugins/highcharts/highcharts.css'),

A PHP Error using Factual

I am using Codeigniter as my PHP framework. When I run the factual API I get results but there are PHP warnings.
Severity: Warning
Message: include(/home/bwilson/public_html/factual/CI_DB.php): failed to open stream: No such file or directory
Filename: factual/Factual.php
Line Number: 217
Severity: Warning
Message: include(): Failed opening '/home/bwilson/public_html/factual/CI_DB.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear')
Filename: factual/Factual.php
Line Number: 217
I a look at line 217 in the factual.php file and it reads:
include dirname(__FILE__)."/".$className . ".php";
What is the referring to? I have tested this without running the Factual API and the controllers load find. It is only when I start using the Factual API.
This is the reply I received from Factual:
The driver employs an SPL Autoload function to include files for
unloaded classes dynamically.
Here, the class CI_DB -- a Codeigniter class, not Factual -- is being
called without being loaded first. This triggers our autoload feature
in a final attempt to load the file.
In short: this is not a Factual driver issue; to solve, ensure the
file containing the CI_DB class is loaded properly.
It's just trying to find CI_DB.php in the same folder as factual.php.
Make sure that file actually exists where it's trying to find it. Pay attention to what case the filename is.
If the file does indeed exist where its supposed to, check its permissions.
After looking for into the error returns unsupported modules. I just disabled the error reporting in the index.php file by setting error reporting to production. In the mean time I am okay with it as long as my results are the same.
Thank you everyone that contributed.
Do you use?:
require_once BASEPATH . "/{$className}.php";

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