PHP 7 session_start() not working

I’ve just installed XAMPP with PHP 7 on my windows 8.1 machine and moved my current project to it.

However, the session_start(); function is not working. The page cannot be load while it is active.

Page is working properly if I comment out session_start();.

How to fix this.


From what I’ve read on the Internet XAMPP seems to have a bug.


My best guess would be that there is an error in the php.ini file that the install is generating.

I installed PHP 7 into an older version of XAMPP a few weeks ago and updated the php.ini myself to get it to work (I don’t have any problems with sessions). The following are the lines in my php.ini in the [Session] section that are not commented by having a ; at the start of the line.

session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies=0 = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

If you compare those values with what you have in your php.ini then that may help you to work out which value is being set incorrectly to cause the problem.

Thank you felgall,

Apart from session error, there are errors with JavaScript seemingly without reason too. I would try what you have suggested.

I haven’t had any issues with PHP 7 and JavaScript - there is absolutely nothing in common between the two to cause problems.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.