*New 11.3 series Release:
2019-10-05: XigmaNAS 11.3.0.4.6928 - released, 11.2 series are soon unsupported!

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

PHP - sessions not working properly after upgrade from 2853

Webserver service.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
noclaf
experienced User
experienced User
Posts: 125
Joined: 08 Dec 2013 12:37
Status: Offline

PHP - sessions not working properly after upgrade from 2853

#1

Post by noclaf » 14 Apr 2017 23:34

Hi,
I upgraded from 10.3.0.3.2853 version to the latest 10.3.0.3.4107

After upgrade my webgallery stopped working (tinywebgallery) claiming that sessions are not available. I changed the sessions folder through webgui webserver conf to another folder than /tmp. However no success, only when I manually edited php.ini as well, the folder was changed. But it was not still enough and I had to 777 the session folder...which is not very secure.

Can somebody please look into it? This is way beyond my knowledge what is causing that. There are some links on the internet claimining that lighttpd has some issues with php sessions, but these links are not very recent.

Thanks

Error logs of the gallery

Before change of path (how the hell something cannot write to tmp???)

Code: Select all

04.14.2017 22:59:39 (en) - ERROR STACKTRACE: 
File:  (Line: )
Function: on_error
Args: 2, Unknown: open(/tmp/sess_aa4275ce44d16043c856e0537ec4b477, O_RDWR) failed: Permission denied (13), Unknown, 0, 

04.14.2017 22:59:39 (en) - ERROR STACKTRACE: 
File:  (Line: )
Function: on_error
Args: 2, Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp), Unknown, 0, 
After change of path (same story)

Code: Select all

04.14.2017 23:00:33 (en) - ERROR STACKTRACE: 
File:  (Line: )
Function: on_error
Args: 2, Unknown: open(/mnt/~my~WWW~folder/session/sess_886d5e6f44bc19efd4bd89322920274c, O_RDWR) failed: Permission denied (13), Unknown, 0, 

04.14.2017 23:00:33 (en) - ERROR STACKTRACE: 
File:  (Line: )
Function: on_error
Args: 2, Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/~my~WWW~folder/session), Unknown, 0, 
Last edited by noclaf on 16 Apr 2017 11:26, edited 1 time in total.

noclaf
experienced User
experienced User
Posts: 125
Joined: 08 Dec 2013 12:37
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#2

Post by noclaf » 16 Apr 2017 09:00

I reverted back to 2853 and everything works fine. In 4107 it seemed that any setting put to the webserver (e.g. session.save_path) is not taken into account. I had to manually edit php.ini after each reboot.

User avatar
ms49434
Developer
Developer
Posts: 715
Joined: 03 Sep 2015 18:49
Location: Neuenkirchen-Vörden, Germany - GMT+1
Contact:
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#3

Post by ms49434 » 16 Apr 2017 16:01

did you try to run web service under root?
1) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 22GB out of 32GB ECC RAM, LSI 9300-8i IT mode in passthrough mode. Pool 1: 2x HGST 10TB, mirrored, SLOG: Samsung 850 Pro, L2ARC: Samsung 850 Pro, Pool 2: 1x Samsung 860 EVO 1TB , services: Samba AD, CIFS/SMB, ftp, ctld, rsync, syncthing, zfs snapshots.
2) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 8GB out of 32GB ECC RAM, IBM M1215 crossflashed, IT mode, passthrough mode, 2x HGST 10TB , services: rsync.

noclaf
experienced User
experienced User
Posts: 125
Joined: 08 Dec 2013 12:37
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#4

Post by noclaf » 16 Apr 2017 20:22

nope, not like the idea for obvious reasons :)
Also this won't solve the question why auxilliary parameters for webserver in GUI are ignored (well, not ignored, but overrided by php.ini)

User avatar
ms49434
Developer
Developer
Posts: 715
Joined: 03 Sep 2015 18:49
Location: Neuenkirchen-Vörden, Germany - GMT+1
Contact:
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#5

Post by ms49434 » 17 Apr 2017 16:30

I installed tinywebgallery and configured web services (running under www on port 81).
I'm on NAS4Free 11.0.0.4 release 4195.
I could not find any issues, tinywebgallery is working properly - including admin pages.

Keep in mind that having two tabs open in a single internet browser instance (one tab with NAS4Free WebGUI and another tab with tinywebgallery) will cause problems because tinywebgallery admin pages will throw an error when trying to access WebGUI session files. Use two different browsers if you want to access WebGUI and tinywebgallery admin pages at the same time.

btw, you cannot change php.ini because you are running NAS4Free embedded.
1) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 22GB out of 32GB ECC RAM, LSI 9300-8i IT mode in passthrough mode. Pool 1: 2x HGST 10TB, mirrored, SLOG: Samsung 850 Pro, L2ARC: Samsung 850 Pro, Pool 2: 1x Samsung 860 EVO 1TB , services: Samba AD, CIFS/SMB, ftp, ctld, rsync, syncthing, zfs snapshots.
2) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 8GB out of 32GB ECC RAM, IBM M1215 crossflashed, IT mode, passthrough mode, 2x HGST 10TB , services: rsync.

noclaf
experienced User
experienced User
Posts: 125
Joined: 08 Dec 2013 12:37
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#6

Post by noclaf » 17 Apr 2017 20:07

Thanks for looking into the issue!

On 2853 I'm able to access in 1 browser both WebGUI and TWG without any problem. So if this is issue on 4xxx+ it is something new. Also - can you please try to modify session save path in webserver auxiliary parameters and check your TWG server/info.php and check that the session path is changed (in my case this auxilliary parameter was ignored). I also assume you are running TWG 2.4.1 - while I'm running 2.4. - am I right?
I'll try to upgrade the TWG together with N4F because it might be interconnected issue.
BTW - I'm able to change php.ini, but my changes are reverted back after restart for obvoius reasons.
----
EDIT
hmh, TWG 2.4.1 shouldn't be the reason, nothing significant in changelog

Code: Select all

2.4.1
- New: $enable_download_for_registered_users_only
- New: Support for $mail->SMTPSecure. e.g. needed for Strato
- New: Support for resonsive youtube videos. Only a ratio of 16:9 is included right now. For other ratios you need to change the style videoIframe-res -> padding-bottom 
- Fix: at php_include mode the ajax calls for the detail page was fixed. 
- Fix: pagingation on mobile devices where not shringed properly. Now by default only 5 elements are shown.
- Security fix: XSS vulnerability after the login in the administration was fixed. 
- Security fix: php mailer used by the flash uploader was updated to 5.2.22 because of a security hole. If you use this you need php > 5.1
- Security fix: forms in the iframes where changed from get to post for enhanced security. 

User avatar
ms49434
Developer
Developer
Posts: 715
Joined: 03 Sep 2015 18:49
Location: Neuenkirchen-Vörden, Germany - GMT+1
Contact:
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#7

Post by ms49434 » 17 Apr 2017 21:54

You cannot change the session save path via auxiliary parameters.
These parameters are added to the websrv.conf file in /var/etc/websrv.conf which is created by /etc/rc.d/websrv and are for the lighttpd configuration. You cannot define an alternative session save path in the auxiliary parameters by setting setenv.add-environment - it's already used and will cause a duplicate error and websrv will not start.

Changes to /usr/local/etc/php.ini will impact the WebGUI as well. You will not gain any benefit by changing php.ini.
You can change php.ini at runtime but you'll loose your changes on reboot because the file is located on a RAM disk. NAS4Free embedded unpacks its image into a RAM disk at boot. If you need more flexibility you should consider to install the full version.
1) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 22GB out of 32GB ECC RAM, LSI 9300-8i IT mode in passthrough mode. Pool 1: 2x HGST 10TB, mirrored, SLOG: Samsung 850 Pro, L2ARC: Samsung 850 Pro, Pool 2: 1x Samsung 860 EVO 1TB , services: Samba AD, CIFS/SMB, ftp, ctld, rsync, syncthing, zfs snapshots.
2) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 8GB out of 32GB ECC RAM, IBM M1215 crossflashed, IT mode, passthrough mode, 2x HGST 10TB , services: rsync.

User avatar
alexey123
Moderator
Moderator
Posts: 1563
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#8

Post by alexey123 » 19 Apr 2017 16:31

Try to add to webroot file named

Code: Select all

.user.ini
and redefine main php.ini settings for your needs
Home11.0.0.4 - Sayyadina (revision 4249)/ x64-embedded on SAPPHIRE Pure Mini E350 / 8G RAM / UPS Ippon Back Power Pro 600
Lab 10.2.0.2 - Prescience (revision 2545) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600
New XigmanasXigmaNAS version 11.2.0.4.6026 on x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM
TEST1 11.0.0.4 - Pilingitam (revision 4333) bpi-embedded on Allwinner a20 / 1015MiB RAM

noclaf
experienced User
experienced User
Posts: 125
Joined: 08 Dec 2013 12:37
Status: Offline

Re: PHP - sessions not working properly after upgrade from 2853

#9

Post by noclaf » 19 Apr 2017 20:56

Will test, thanks!

Post Reply

Return to “WebServer”