PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Need help installing Joomla! 3.x? For all Joomla! 3.x installation issues please use this forum.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
chtrede
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 140
Joined: Tue Aug 28, 2007 9:38 am

PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Post by chtrede » Mon Nov 29, 2021 11:39 am

Hi there,
I moved my Joomla installation 3.10.3 to a new server. On that machine the installation does not run anymore under PHP 7.4, but only under PHP 7.3.
As an error message I get

[code]Warning: session_start(): Failed to read session data: user (path: /var/cpanel/php/sessions/ea-php74) in /home/yyyyyy/public_html/libraries/joomla/session/handler/native.php on line 260
Error: Failed to start application: Failed to start the session[/code]

Any ideas?

Thanks a lot
Last edited by imanickam on Tue Nov 30, 2021 6:19 am, edited 1 time in total.
Reason: Changed the Subject to reflect the issue/question

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 24985
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Server moved - Joomla not workind anymore under PHP 7.4

Post by pe7er » Mon Nov 29, 2021 3:36 pm

How did you move your website to another server?
Did you use Akeeba Backup to backup and kickstart to restore it?

It seems that your website is not able to get the session data from the database.
Are your database settings correct (in configuration.php) ?


btw: Using PHP7.3 is not a good idea because on 6 Dec 2021 the support for PHP 7.3 security patches ends, see:
https://www.php.net/supported-versions.php
Kind Regards,
Peter Martin, Global Moderator
Company website: https://db8.nl/en/ - Joomla specialist, Nijmegen, Netherlands
The best website: https://the-best-website.com

User avatar
abernyte
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4189
Joined: Fri May 15, 2009 2:01 pm
Location: Écosse - Scozia - Escocia - Škotija -स्कॉटलैंड

Re: Server moved - Joomla not workind anymore under PHP 7.4

Post by abernyte » Mon Nov 29, 2021 4:30 pm

Ensure that the mysqli module is enabled in php7.4.
"Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it." Thomas Paine

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30929
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Server moved - Joomla not workind anymore under PHP 7.4

Post by Per Yngve Berg » Mon Nov 29, 2021 5:33 pm

Make sure the session Path is writeable. As you can see, the path is different for php 7.3 and 7.4

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Post by sozzled » Mon Nov 29, 2021 5:54 pm

See viewtopic.php?t=982009. The problem can be caused by any number of a dozen reasons. As @abernyte says, it could be caused by not enabling the MySQLi PHP extension (if the file configuration.php specifies mysqli as the database connection method); as @Per says, it could be caused if save.session.path is not defined; as @pe7er says, it could be caused if the configuration.php file settings are misconfigured.

The problem can also be caused if some of the "optional" technical requirements for J! 3.x are not met; errors will result if you are using the database to save sessions and the _sessions table is full.

I have been researching this "'Error: Failed to start application: Failed to start the session" problem over the past three to four weeks in preparing an article. I can't tell you where to find this article—that would be self-promotion and that's against the forum rules—but I've summarised the various common (and some not-so-common) reasons. I am following this topic to see if we've found another cause for the error and, if we have, I will add it to my list. 8)

dorsa
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Jul 29, 2013 5:46 am

Re: PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Post by dorsa » Sun Aug 28, 2022 4:52 am

I have hosted web application develop using joomla in ubuntu 20 and use mysql as database. one i hosted and viewed in the web browser it show me Error: Failed to start application: Failed to start the session

i have used php 7.4, mysql Ver 8.0.27, apache Apache/2.4.41 (Ubuntu)

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Post by sozzled » Sun Aug 28, 2022 5:05 am

@dorsa: see above for the answer to your question.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30929
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Post by Per Yngve Berg » Sun Aug 28, 2022 6:23 am

Edit configuration.php

Find

Code: Select all

public $session_handler = 'none';
If set to 'database', then change it. This is the preffered method with php 7 and above.

If still show Session error, the save.session_path on the server is not writable.
If you get a database connect error, the you have a problem connecting to the database.

save.session_path is set in php.ini

sozzled
I've been banned!
Posts: 13639
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Post by sozzled » Sun Aug 28, 2022 6:31 am

@Per: please read the forum category. We're discussing J! 3.x here, not J! 4.x. 8)

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30929
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: PHP 7.4: 'Error: Failed to start application: Failed to start the session'

Post by Per Yngve Berg » Sun Aug 28, 2022 6:53 am

Corrected. It's now 'none' for J3 instead of 'filesystem'

I don't know where I saw the J4 forum.


Locked

Return to “Installation Joomla! 3.x”