PHP 7.0.1 session_start()

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP 7.0.1 session_start()

Postby mortenll » 04. January 2016 09:44

I have installed latest xamp with php 7 on windows 10. (all setings on default except password)
Now i have a problem with session_start() in php script.

This script works
<?php
echo "Hello world";
?>

This script does not work (can't find URL errormessage?)
<?php
session_start();
echo "Hello world";
?>

If i install xamp with php 5.6.15 on windows 10 (all setings on default except password) it work fine, so i suspect it's has something to do with either latest xamp package or php 7.
Any suggestions ?

Best regards Morten
mortenll
 
Posts: 6
Joined: 04. January 2016 08:58
Operating System: windows

Re: PHP 7.0.1 session_start()

Postby Nobbie » 04. January 2016 11:36

mortenll wrote:This script does not work (can't find URL errormessage?)


Please provide the fully qualified error message. "Does not work" is insufficient.
Nobbie
 
Posts: 8769
Joined: 09. March 2008 13:04

Re: PHP 7.0.1 session_start()

Postby mortenll » 04. January 2016 12:56

Have to uninstall 5.6.15 and reinstall 7.0.1 first. Will do that later.
Just the complete errormessage in the browser ? or do you refer to log file somewhere ?
mortenll
 
Posts: 6
Joined: 04. January 2016 08:58
Operating System: windows

Re: PHP 7.0.1 session_start()

Postby Altrea » 04. January 2016 14:27

This seems to be a bug in XAMPPs php configuration or one of the Apache/PHP binaries.
Apache crashes and restarts every request.

Another Ressource (german):
http://www.php.de/forum/webentwicklung/ ... nicht-mehr
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8290
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: PHP 7.0.1 session_start()

Postby Nobbie » 04. January 2016 16:36

Yes, thats a bug in Xampp/PHP7 (or Apache), i could reproduce that error on a Xampp 7 installation. A call to start_session() hangs up Apache. Thats a big one!

Some people already checked out Apache and PHP7 separately from the corresponding development sites and it runs flawlessly. So this is a bug which only appears in the Xampp environment.
Nobbie
 
Posts: 8769
Joined: 09. March 2008 13:04

Re: PHP 7.0.1 session_start()

Postby mortenll » 05. January 2016 09:53

Continued from first mail and reply

Here is error message in browser when you try to run php script with session_start()

Not Found
The requested URL /MyPHPFiles/Login/test.php was not found on this server.
________________________________________
Apache/2.4.10 (Ubuntu) Server at www.localhost.dk Port 80

I see others found same error so guess i have to wait for fix.
mortenll
 
Posts: 6
Joined: 04. January 2016 08:58
Operating System: windows

Re: PHP 7.0.1 session_start()

Postby Nobbie » 05. January 2016 11:03

mortenll wrote:Continued from first mail and reply

Here is error message in browser when you try to run php script with session_start()

Not Found
The requested URL /MyPHPFiles/Login/test.php was not found on this server.
________________________________________
Apache/2.4.10 (Ubuntu) Server at http://www.localhost.dk Port 80

I see others found same error so guess i have to wait for fix.


This is a totally different error, as you can see, it is NOT issued from "localhost" but from "www.localhost.dk" and that is an Ubuntu(!) Linux server, whereas your server at home is a Windows server. I dont know, what is going wrong there, but it does not look like the typical session_start() error (which hangs the locally installed Apache).
Nobbie
 
Posts: 8769
Joined: 09. March 2008 13:04

Re: PHP 7.0.1 session_start()

Postby mortenll » 05. January 2016 12:37

As mentioned in first mail running test script without session_start() works fine.
So, another error but still related to session_start().

If you change "session_auto_start=0" to "session_auto_start=1" in php.ini file and run script

<?php
echo "Hello world";
?>

you again get same error message in browser.
Just another hint for debugging what wrong with session support in xamp 7.0.1 for windows.
mortenll
 
Posts: 6
Joined: 04. January 2016 08:58
Operating System: windows

Re: PHP 7.0.1 session_start()

Postby mortenll » 05. January 2016 12:59

Just tested on windows 7.
Same problem as windows 10.
mortenll
 
Posts: 6
Joined: 04. January 2016 08:58
Operating System: windows

Re: PHP 7.0.1 session_start()

Postby RWashington » 06. January 2016 15:10

Hi All

I have exactly the same problem. Is really weird. Looking at the logs it says -

[Wed Jan 06 13:55:46.358499 2016] [ssl:warn] [pid 8264:tid 268] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 06 13:55:46.392499 2016] [mpm_winnt:notice] [pid 8264:tid 268] AH00354: Child: Starting 150 worker threads.

I've tried everything I can think of. Turned of SSL. Reinstalled. Changed Ports. Etc etc...

Switching to MAMP for now. Been pulling my hair out for two days on this now.

It does seem like a problem with xammp.

Regards
RWashington
 
Posts: 2
Joined: 06. January 2016 15:00
Operating System: Windows 7

Re: PHP 7.0.1 session_start()

Postby Altrea » 07. January 2016 20:42

Hi Folks,

Here is the answer from the Bitnami Developers:

we have been checking the configuration of XAMPP and we found that the issue is related to the use_only_cookies variable that you can find in the Session's section of the php.ini file. Apache will crash if the use_only_cookies variable in the Session's section is set to 0 and everything is fine if it's set to 1.

http://php.net/manual/en/session.configuration.php#ini.session.use-only-cookies

We also checked that the use_strict_mode should be set to 1.

https://wiki.php.net/rfc/strict_sessions
http://php.net/manual/en/session.configuration.php#ini.session.use-strict-mode

We'll include those changes in the next version of XAMPP with PHP 7. We are building the installers with the version 7.0.2 and we'll release them as soon as possible.


best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8290
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: PHP 7.0.1 session_start()

Postby mortenll » 13. January 2016 10:29

Great.
Thanks for the response :-)

Best regards
Morten
mortenll
 
Posts: 6
Joined: 04. January 2016 08:58
Operating System: windows

Re: PHP 7.0.1 session_start()

Postby RWashington » 13. January 2016 10:37

Yes really helpful thank you

We now use MAMP, seems to work well with PHP7.

It doesn't give you the kind of options etc as XAMPP but it does get you up and running with a minimum of fuss really quickly.
RWashington
 
Posts: 2
Joined: 06. January 2016 15:00
Operating System: Windows 7

Re: PHP 7.0.1 session_start()

Postby ganjeii » 21. January 2016 20:29

This fixed it thanks so much!!!!
ganjeii
 
Posts: 1
Joined: 21. January 2016 20:26
Operating System: Windows 7, 8, 10

Re: PHP 7.0.1 session_start()

Postby Altrea » 05. February 2016 00:56

Hi Mike,

Which XAMPP version do you use?

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8290
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 74 guests