Issues with PHP 5.3 and sessions folder
The fix: In your php.ini
set session.gc_probability
to 0
The cause
I believe I found the answer here http://somethingemporium.com/2007/06/obscure-error-with-php5-on-debian-ubuntu-session-phpini-garbage
Essentially, the garbage collection is set up to be done by cron jobs on some systems (i.e. Ubuntu/Debian). Some php ini executables like php-cli also try to do garbage collection and that results in the error you got.
PHP Session Storage / Update Issue
I came around a variety of different issues when trying to combine PHP's native $_SESSION
s with some of my project setups. The main issue was my attempt to try to combine PHP Sessions (stateful) with stateless approaches like REST
. I finally concluded that in such cases, it's better to implement your own session handling using performant DB solutions like redis, or simply setup your own logic by adapting PHP's native session handling.
local php.ini sessions.save_path issue - sessions not recognised
You should place your session and upload directories outside of the document root otherwise these will be accessible by anyone and can result in remote script injection, session hijacking etc.
You should perhaps create a tmp directory as /home/aspac124/tmp
and set the permissions so Apache can write to this directory. Perhaps set the chmod to 0760.
error when saving php sessions in project's directory
I was able to reproduce the same exact error, creating the session file but throwing "Session data file is not created by your uid.", but I am not sure if this is your case.
Anyway, my guess is that you are using an nfs server to keep your code, but you develop and run nginx locally. You made a nfs mount to the server directory to sync your code to the server(we had the same in one of my previous employments).
So you mount the nfs server directory to a local directory. What happens is that php creates your session file with user www-data, but this user has a different uid on the server than your local machine. So file is created, you see the correct owner, but its uid is different.
Check:
link
link
This is just my best guess. If this is it, let me know, maybe I could help with nfs user mapping. Hope it helps.
Related Topics
Set Active State on Navigation Dynamically
How to Install Pdo_Sqlsrv on My Windows 2008 Server 2008 R2
Get the First or Last Friday in a Month
How to Dynamically Build Queries with Pdo
Highlight Keywords in a Paragraph
Running a Zend Framework Action from Command Line
Sending Multiple Data Parameters with Jquery Ajax
Wampserver PHPmyadmin Maximum Execution Time of 360 Seconds Exceeded
Dynamically Changing Image Colours
How to Find Number of Mondays or Tuesdays Between Two Dates
Storing Database Connection in a Session Variable
Applied Coupons Disable Free Shipping Conditionally in Woocommerce
How to Return a Proper Success/Error Message for Jquery .Ajax() Using PHP