Welcome Guest, Not a member yet? Register   Sign In
Weird autoload bug
#1

[eluser]georgeedwards[/eluser]
Hello all. I've had a production site live for a few months now (ftw.gd) but today just randomly discovered an error. I think it may be due to a hosting PHP upgrade, but they say they haven't upgraded anything. Not a great help.

But anyway, it seems as though, I can't autoload Session properly anymore. In fact, I can't load the library anywhere.

My autoload is:
Code:
$autoload['libraries'] = array('database', 'session');

This produces:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$session

Filename: views/header.php

Line Number: 43

The funny thing is, if I take out autoloading of the database library, the Session library loads successfully and works fine.

What gives? Any ideas?
#2

[eluser]Learn CodeIgniter[/eluser]
And what is on line 43 in header.php
#3

[eluser]georgeedwards[/eluser]
Err,

Code:
<?php if ($this->session->flashdata('flash')): ?>

Just a simple check for flash data.

But this is kinda irrelevant, like I say, it's worked without interruption for months then all of a sudden - boom.
#4

[eluser]georgeedwards[/eluser]
Also, I can confirm that Session is being loaded. If I put on the line above:

Code:
<?php $this->load->library('session'); ?>

... this loads without error. But calling any session member function just errors. Or, if I var_dump the Session class, I don't get anything back.

Very weird Sad
#5

[eluser]Learn CodeIgniter[/eluser]
What version of CI are you using?
#6

[eluser]georgeedwards[/eluser]
1.7.2. Thanks for your help.

I am very, very confused.
#7

[eluser]Learn CodeIgniter[/eluser]
You could have some corrupted files, this happened to me once before.

Try re-downloading Codigniter and re-install it.
#8

[eluser]georgeedwards[/eluser]
[quote author="Learn CodeIgniter" date="1290076166"]You could have some corrupted files, this happened to me once before.

Try re-downloading Codigniter and re-install it.[/quote]

Thanks. But already tried that. I also replaced the production copy of the code with my development copy, and still - the same error.

It's very very weird. I am beginning to think it must be a server problem...

Any more suggestions on where to look?

Cheers
#9

[eluser]georgeedwards[/eluser]
Gotcha! It was a hosting issue. My host had disabled mysql_pconnect, but it was not throwing these errors.

Enabled debug logging, and noticed it Smile

Thanks, hope this can help someone else in the future?
#10

[eluser]Narkboy[/eluser]
Nice host to tell you they haven't changed the hosting when they have.. Sad




Theme © iAndrew 2016 - Forum software by © MyBB