Search code examples
phpsessionwamp

PHP uses wrong session save path


I have been developing a site on my PC with wamp, now when I uploaded the files to my production server and try out my account system PHP insists on saving the session to the WAMP folder(it shows the exact directory I have on my PC) but that directory obviously doesn't exist on my production server and it should use cPanel's tmp folder as specified in php.ini I also haven't specified another session save path in my PHP scripts Does anyone have any clue what is causing this? My php.ini

; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

allow_url_fopen = On
error_reporting = E_ALL
log_errors = On
error_log = "/home/seffcraf/public_html/statusmc.seffcraft.eu/php_errors.log"
detect_unicode = Off
display_errors = On
enable_dl = On
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 32M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/home/seffcra1/public_html/statusmc.seffcraft.eu/tmp"
upload_max_filesize = 2M
zlib.output_compression = Off
extensions=sockets

The error:

Warning: session_start(): open(E:/wamp64/tmp/sess_fg79n0c5ek7vfpp2e5n43m94ct, O_RDWR) failed: No such file or directory (2)

Warning: session_start(): Failed to read session data: files (path: E:/wamp64/tmp)

Solution

  • SOLVED: I found that there was a fault .user.ini file in the document root which I don't even know why it was there, I have now removed it and everything is working fine.