Page 1 of 1

PHP 7.0.1 session_start()

PostPosted: 04. January 2016 09:44
by mortenll
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

Re: PHP 7.0.1 session_start()

PostPosted: 04. January 2016 11:36
by Nobbie
mortenll wrote:This script does not work (can't find URL errormessage?)


Please provide the fully qualified error message. "Does not work" is insufficient.

Re: PHP 7.0.1 session_start()

PostPosted: 04. January 2016 12:56
by mortenll
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 ?

Re: PHP 7.0.1 session_start()

PostPosted: 04. January 2016 14:27
by Altrea
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

Re: PHP 7.0.1 session_start()

PostPosted: 04. January 2016 16:36
by Nobbie
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.

Re: PHP 7.0.1 session_start()

PostPosted: 05. January 2016 09:53
by mortenll
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.

Re: PHP 7.0.1 session_start()

PostPosted: 05. January 2016 11:03
by Nobbie
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).

Re: PHP 7.0.1 session_start()

PostPosted: 05. January 2016 12:37
by mortenll
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.

Re: PHP 7.0.1 session_start()

PostPosted: 05. January 2016 12:59
by mortenll
Just tested on windows 7.
Same problem as windows 10.

Re: PHP 7.0.1 session_start()

PostPosted: 06. January 2016 15:10
by RWashington
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

Re: PHP 7.0.1 session_start()

PostPosted: 07. January 2016 20:42
by Altrea
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

Re: PHP 7.0.1 session_start()

PostPosted: 13. January 2016 10:29
by mortenll
Great.
Thanks for the response :-)

Best regards
Morten

Re: PHP 7.0.1 session_start()

PostPosted: 13. January 2016 10:37
by RWashington
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.

Re: PHP 7.0.1 session_start()

PostPosted: 21. January 2016 20:29
by ganjeii
This fixed it thanks so much!!!!

Re: PHP 7.0.1 session_start()

PostPosted: 05. February 2016 00:56
by Altrea
Hi Mike,

Which XAMPP version do you use?

best wishes,
Altrea