View Full Version : Undefined Index Pain In The A...

04-26-2012, 10:03 PM
Hi there.

I have an error occuring, not all the time, just now and again. I have a feeling it might be session expiry settings but I'm not sure...

It's happened once with me just after I left the page for a time and then went to click next page..

error_reporting (E_ALL ^ E_NOTICE);

if(isset($_POST['postcode'])) { $_SESSION['postcode']=$_POST['postcode']; }
$usrPostcode = formatBritishPostcode($_SESSION['postcode']);

I haven't pinned down when it's happening yet

If anyone can help

04-26-2012, 10:31 PM
This also pops up around the same time too

function.session-start</a>]: ps_files_cleanup_dir: opendir(/var/lib/php5) failed

04-26-2012, 10:51 PM
I've set my php.ini file to have this

session.gc_probability = 0

Problem is. When I putty in to my server anbd do a search for php.ini I find several files. I editied the one on my VPS Shared hosting which came under my domain name folder.

I've only just restarted the folder, so no idea if that helped yet..

04-26-2012, 11:22 PM
You do realise that the .org.uk domain is for non-profit organisations don't you?

Instead of posting just a few minimal lines of code, please show us the file in [php] tags.

04-26-2012, 11:52 PM
What are all the errors you receive in their entirety?
That second one in specific is a failed C function call. But its not really helpful as it sits unless there's more information on why it failed to open that path (permission denied? Path not found?).
I wouldn't set the probability of the garbage collection to 0. That'll just leave files to never get cleaned up.

04-27-2012, 08:23 PM
It appears to be a permission problem rather than a coding one.

I think the var/lib/php folder doesn't have the right access.

I have chmod it to 777 755 still cause the same error to occur.

I am not sure I want it set at 777 so if anyone has any thought.

Thanks very much..

04-27-2012, 08:27 PM
Post the errors in their entirety. Having an error simply saying it has failed doesn't help.

As for permissions, make sure you check the umask settings as well.