Fix logging in in PHP 5.3 #11430

Merged
merged 1 commit into from Aug 4, 2016

Projects

None yet
@wilsonge
Member
wilsonge commented Aug 4, 2016 edited

Pull Request for Issue #11428 .

Summary of Changes

Fixes login in PHP 5.3

Testing Instructions

Test logging in and logging out. In PHP 5.4+ continues to work in 5.3 it starts working again

@wilsonge wilsonge Fix logging in in PHP 5.3
cfcaac3
@wilsonge
Member
wilsonge commented Aug 4, 2016

Marking test of @sarsami from #11428


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11430.

@mediosweb

i have made suggested modfications, and still get same error:
Se ha producido un error.

0 Failed to start the session: already started by PHP ($_SESSION is set). 
@Sandhie
Sandhie commented Aug 4, 2016

Works for me... Thank you!

@mediosweb

Has worked !
sorry i missed line 154
now its ok!
thanks!!!

@missnene
missnene commented Aug 4, 2016

IT WORKS!!! ๐Ÿ‘ Thanks!
I think if I saw that failed to start session error one more time, I wouldn't own a laptop anymore. ๐Ÿ˜‚

@Flow1976
Flow1976 commented Aug 4, 2016

I have a same problem :(
0 Failed to start the session: already started by PHP ($_SESSION is set).


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11430.

@Flow1976
Flow1976 commented Aug 4, 2016

๐Ÿ‘ Thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11430.

@joomdonation
Contributor

I have tested this item โœ… successfully on cfcaac3

Tested on two test sites:

  1. One site running on PHP 5.3: Before patch, we had issue with Login. After patch, login works.
  2. One site running on PHP 5.6: Login still works after applying the patch.
    This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11430.
@khanhlh
Contributor
khanhlh commented Aug 4, 2016

The fix works. Anyway, set default value for $started as false and $closed as true is enough to fix the issue.

@wilsonge wilsonge merged commit 1a6a250 into staging Aug 4, 2016

3 checks passed

JTracker/HumanTestResults Human Test Results: 2 Successful 0 Failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@joomla-ua

PHP 5.3.17 after apply patch work perfect!

@wilsonge wilsonge deleted the fix-5.3-login branch Aug 4, 2016
@wilsonge
Member
wilsonge commented Aug 4, 2016

Thanks guys. I've merged this. I'll hold until this evening to make sure there are no more issues that are going to crop up. But probably will be a 3.6.2 tonight with this in

@rdeutz rdeutz added this to the 3.6.2 milestone Aug 4, 2016
@PhilETaylor
Contributor

If you are running PHP 5.3 then you have bigger issues than just this. Pathetic.

@jrmain
jrmain commented Aug 4, 2016

@PhilETaylor - in my case, as it likely is with many other people still technically running PHP 5.3, what I'm actually running is a version of PHP 5.3 that's had relevant post-5.3 security fixes applied to it, such as the versions available for Ubuntu LTS releases. I actually prefer to run tried and tested version of PHP, rather than the latest versions with new features and changes that are typically the source of new security vulnerabilities. Of course, eventually I'll have to upgrade when certain new features become necessary.

@jrmain
jrmain commented Aug 4, 2016

This fix worked perfectly for me. Looking forward to the official fix in 3.6.2. Thanks!

@PhilETaylor
Contributor

There is no reason at all for running PHP 5.3 in July 2016... its all excuses I have heard time and again.

@elistina
elistina commented Aug 4, 2016

IT WORKS!!! Thanks a lot!

@jrmain
jrmain commented Aug 4, 2016

@PhilETaylor - Yeah, well, that's just, like, your opinion, man. I would rather run a secure server than one that supports features I don't need.

@smu77
smu77 commented Aug 4, 2016

Thx a lot. Works fine!

@mbabker
Member
mbabker commented Aug 4, 2016

Not sure how a server running unsupported software is secure but that's neither here nor there regarding this issue.

@Luisriveraa

Great. I works fine. Thanks a lot.

@Nexthought

How can I apply the patch ? I have no directory where to put it and can't open the joomla session. Please help !! ๐Ÿ˜ฐ

@Nexthought

@wojsmol I saw it but I don't know where/how to apply it to make it effective. I am just beggining in this stuff.

@lalapo1
lalapo1 commented Aug 4, 2016 edited

@Nexthought go here and copy:
https://raw.githubusercontent.com/joomla/joomla-cms/cfcaac3b7bf553a33a6bced765f3b8bdcb2f41fb/libraries/joomla/session/handler/native.php

replace

in

route

public_html/libraries/joomla/session/handler/native.php

native.php

regards

@PhilETaylor
Contributor

I have tested this item โœ… successfully on cfcaac3

I used Joomla 3.6.1 Stable, _PHP 5.3.29_, on attempting to Login to frontend as super admin I get the common reported error message

I then manually applied patch from https://patch-diff.githubusercontent.com/raw/joomla/joomla-cms/pull/11430.patch with patch -p0 < patch and retested.

I was able to login in and out on the frontend and the admin console with a super admin with no errors.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11430.

@microtribe

I applied this fix and it worked running PHP 5.3. But upgrading to PHP 5.6 worked too and didn't require this fix.

@brianteeman
Contributor

On 4 Aug 2016 7:55 p.m., "Tony" notifications@github.com wrote:

I applied this fix and it worked running PHP 5.3. But upgrading to PHP
5.6 worked too and didn't require this fix.

Obviously because this is only needed on 5.3

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@PhilETaylor
Contributor

I applied this fix and it worked running PHP 5.3. But upgrading to PHP 5.6 worked too and didn't require this fix.

Which is actually the CORRECT reaction to hitting a bug like this - well done. Upgrading is FTW.

@eduardocfs

Works for me... Thank you!
I will follow the @PhilETaylor advice and upgrade my PHP.

@ninj1766
ninj1766 commented Aug 5, 2016

what file name and where do I need to paste in this patch? Please.
Do I need to edit/replace any other code?

@ninj1766
ninj1766 commented Aug 5, 2016

Also I am using PHP 5.39 right now

@PhilETaylor
Contributor

Also I am using PHP 5.39 right now

There is no such version!

5.3.9? 5.3.29? Those are valid (albeit end of life, insecure, buggy, historic, ancient) versions.

@ninj1766
ninj1766 commented Aug 5, 2016

5.4 now at the time of the error it was 5.3 so should I revert back to 5.3 to use this patch and where do I place it? Please. I am not a coder but I can manage my C-Panel file manager and copy and paste.

@Nexthought
Nexthought commented Aug 5, 2016 edited

@ninj1766 did you set your ftp server ?

@motofficina
motofficina commented Aug 5, 2016 edited

I encountered the same problem yesterday when I was trying to log in on the back end. An error message appears as "Failed to start the session: already started by PHP ($_SESSION is set)"

Originally, my joomla website is on 3.6.0 version and then, there was an available update to 3.6.1 so I tried. First there was an error, but when I clicked back, the update was successful. Then, after a few hours I wasn't able to log in on the back end anymore nor on the front end.

I don't know technically what I need to do especially about erasing or adding a code in a php or whatever file it could be because I am not familiar with the programming language... but I'm willing to learn step by step and I can manage to do the repair as much as I can. Please help me!!!

Urgent...

@brianteeman
Contributor

@motofficina please use the forum for support http://forum.joomla.org

@wilsonjda

Hello everybody, I have a problem, I tried to fix the file native.php but now I had a blank page.

@ggppdk
Contributor
ggppdk commented Aug 5, 2016 edited

Hello everybody, I have a problem, I tried to fix the file native.php but now I had a blank page.

while trying to apply the fix you have broken the SYNTAX of the file

  • error is not displayed by default thus it is hidden

Just restore the file

Now , If you have J3.6.1 !!

  1. Edit file
    libraries/joomla/session/handler/native.php
  2. Delete all contents (do not save yet)
  3. Carefully copy paste ALL text from here:
    https://raw.githubusercontent.com/joomla/joomla-cms/3.6.2/libraries/joomla/session/handler/native.php
  4. Save file , now you can login and update to J3.6.2

You can also do "Save as" in your browser for the above link and replace the file too

For anything more, please post here:
http://forum.joomla.org

@wilsonjda

Hello ggppdk, thanks for your answer, I did what you said, but it doesn't work, blank page and in the Chrome console said: Error 500.

@ggppdk
Contributor
ggppdk commented Aug 5, 2016 edited

are you sure that you copy pasted the exact text ?
are you sure that you have not editted ANY other files ?

also you may need to close all browser windows and re-open the browser (forces login session to expire)

Do the above and if it does not work then do this:

  1. Rename the file libraries/joomla/session/handler/native.php
  2. Do a "save as" of: https://raw.githubusercontent.com/joomla/joomla-cms/3.6.2/libraries/joomla/session/handler/native.php
  3. Save it as: native.php Copy it to: libraries/joomla/session/handler/native.php
  4. Close all browsers windows, restart your browser, login and upgrade to J3.6.2

Finally it is possible to see the error of the "blank" page

Edit (you may need to make it writable (temporarily))

  • configuration.php

change:

public $error_reporting = 'default';

to: (see errors)

public $error_reporting = 'simple';

or to see errors / notice / warnings too

public $error_reporting = 'maximum';

Other option is to extract the full J3.6.2 package ... ask how here: http://forum.joomla.org (I will not answer any further in this thread)

@wilsonjda

I changed error reporting and there a problem with Akeeba Backup, I'm going talk to my client in order to they update PHP version. Thanks for your advice it is not a joomla issue, excuse me.

@motofficina

hey, thanks! it worked :D

@Belaswan

I can't login from frontend after upgrade from joomla 3.6.1 to joomla 3.6.2


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11430.

@Edu20 Edu20 pushed a commit to Edu20/joomla-cms that referenced this pull request Aug 11, 2016
@wilsonge wilsonge + Eduard Ellert Fix logging in in PHP 5.3 (#11430) 756c90b
@roland-d roland-d added a commit to roland-d/joomla-cms that referenced this pull request Sep 11, 2016
@wilsonge @roland-d wilsonge + roland-d Fix logging in in PHP 5.3 (#11430) 48542b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment