Modified PHP settings caused errors on my Joomla 3.x site

Discussion regarding Joomla! 3.x security issues.

Moderators: Bernard T, mandville, fcoulter, PhilD, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant / FPA - If you are serious about wanting help, you will use this tool to help you post.
webgyrl
Joomla! Explorer
Joomla! Explorer
Posts: 440
Joined: Sun Jun 11, 2006 7:31 am
Location: Planet Earth Most of the Time

Modified PHP settings caused errors on my Joomla 3.x site

Postby webgyrl » Tue Nov 14, 2017 10:54 am

I am going through trying to harden security on all my Joomla sites.

I have been experimenting with PHP settings and turned these off using a php.ini file in the main folder of this site on my shared hosting server (SiteGround).

expose_php = Off
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

I just tried it and got this error:

Warning: array_key_exists() expects parameter 2 to be array, null given in /home/xxxxx/public_html/domain.com/libraries/cms.php on line 62
Error displaying the error page: Application Instantiation Error: Failed to start the session because headers have already been sent by "/home/xxxxx/public_html/domain.com/libraries/cms.php" at line 62.

Server is shared server, but I uploaded php.ini to the specific website folder. Settings are:
PHP Built On Linux 3.12.18-clouder0 #85 SMP Mon Apr 3 10:28:14 EEST 2017 x86_64
Database Version 5.6.36-82.1-log
Database Collation utf8_general_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.0.25
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.8.2 Stable [ Amani ] 7-November-2017 15:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

Any ideas why the site failed?

Thanks!
Always learning...

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4027
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: Modified PHP settings caused errors on my Joomla 3.x site

Postby itoctopus » Tue Nov 14, 2017 2:48 pm

Your $_SERVER PHP array is passed empty. Not sure which of the above settings caused it. I would experiment by enabling them one by one until the culprit is found.
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

webgyrl
Joomla! Explorer
Joomla! Explorer
Posts: 440
Joined: Sun Jun 11, 2006 7:31 am
Location: Planet Earth Most of the Time

Re: Modified PHP settings caused errors on my Joomla 3.x site

Postby webgyrl » Tue Nov 14, 2017 4:18 pm

Ok thanks I will try that. Cheers!
Always learning...

User avatar
JAVesey
Joomla! Ace
Joomla! Ace
Posts: 1689
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Modified PHP settings caused errors on my Joomla 3.x site

Postby JAVesey » Mon Dec 11, 2017 7:59 pm

webgyrl wrote:Warning: array_key_exists() expects parameter 2 to be array, null given in /home/xxxxx/public_html/domain.com/libraries/cms.php on line 62
Error displaying the error page: Application Instantiation Error: Failed to start the session because headers have already been sent by "/home/xxxxx/public_html/domain.com/libraries/cms.php" at line 62.

...

Any ideas why the site failed?


Yes! Same thing happened to me after I moved servers and updated the PHP version.

Solution:
In /administrator:

System > Clear Caches

Clear the site cache and the expired cache.
John V
Cardiff, Wales, UK
Website: https://www.llanmon.org.uk (Joomla 3.8.10)

webgyrl
Joomla! Explorer
Joomla! Explorer
Posts: 440
Joined: Sun Jun 11, 2006 7:31 am
Location: Planet Earth Most of the Time

Re: Modified PHP settings caused errors on my Joomla 3.x site

Postby webgyrl » Thu Jan 11, 2018 12:08 pm

Thanks! I got it fixed.
Always learning...

User avatar
JAVesey
Joomla! Ace
Joomla! Ace
Posts: 1689
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Modified PHP settings caused errors on my Joomla 3.x site

Postby JAVesey » Thu Jan 11, 2018 4:54 pm

webgyrl wrote:Thanks! I got it fixed.
It would help others if you shared the solution.
John V
Cardiff, Wales, UK
Website: https://www.llanmon.org.uk (Joomla 3.8.10)

webgyrl
Joomla! Explorer
Joomla! Explorer
Posts: 440
Joined: Sun Jun 11, 2006 7:31 am
Location: Planet Earth Most of the Time

Re: Modified PHP settings caused errors on my Joomla 3.x site

Postby webgyrl » Thu Jan 11, 2018 5:21 pm

JAVesey wrote:
webgyrl wrote:Thanks! I got it fixed.
It would help others if you shared the solution.

It was with the clear cache suggestion above my latest post.
Always learning...

User avatar
JAVesey
Joomla! Ace
Joomla! Ace
Posts: 1689
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Modified PHP settings caused errors on my Joomla 3.x site

Postby JAVesey » Thu Jan 11, 2018 7:04 pm

webgyrl wrote:It was with the clear cache suggestion above my latest post.
:D
John V
Cardiff, Wales, UK
Website: https://www.llanmon.org.uk (Joomla 3.8.10)


Return to “Security in Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 4 guests