Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2110

Administration Joomla! 5.x • Diabolical dramas with J5 SEO and htaccess files [SOLVED]

$
0
0
Fun with SEO / htacess crashing Joomla 5

I’m typing this up in the hope that it may help others one day. I had a situation where as soon as I changed over the htaccess on an already installed Joomla 5 site I received the message that PHP8.1 is the minimum and the whole of the site was then borked.

This write up may seem a little long and tedious, but the issue was even worse.

I’ve got my own Virtual Private Server that I use for hosting Joomla sites and others. I have Joomla 4 sites that are configured and running for full SEO with the urls and these are perfectly fine.

So you can imagine my surprise when I ran into the difficulties with my first Joomla 5 site.

I set the hosting account within CPanel's WHM on the server to be PHP v8.3 via the “MultiPHP Manager” (which applies it to the public_html directory) and got to work. Joomla 5 installed beautifully and the whole thing is so fast it has a good ‘snap’ to it when it comes to the responsiveness. Happy times!

Soon enough I was in the System-->Global Configuration and kicked the “Use URL rewriting” slider over to “yes”. Yup, everything working properly except for the unsightly “index.php” remaining. So I then go into the public_html directory and changed over the installed .htaccess to the file supplied as htaccess.txt

Upon my next click I was presented with “the orange screen of oh-no” and I was promptly informed that “Sorry, your PHP version is not supported. Your host needs to use PHP version 8.1.0 or newer to run this version of Joomla.”

This was super weird and made no sense at all given that I had just successfully installed Joomla 5 on this account with PHP 8.3, and this was previously verified in System Information-->PHP.

I also noted that the error also surfaced when I had no .htaccess file in the base installation directory at all. There weren’t any PHP error logs to glean information from either as presumably PHP didn’t have a chance to start let alone get a look in on the issue.

Not much to work with on this one. Almost zero clues and forensically examining the innards of a htaccess file is well beyond me.

It’s always possible that there was a very slight difference in the htaccess file contents between the v4 and v5 of Joomla. So I had this cunning idea that I could install and config the site on the latest J4 (with SEO and everything confirmed working) and then upgrade it through to J5 and completely side step the show stopper issue. I am so plenty-smart! :)

The SEO configured J4 worked beautifully. A J5 still didn’t (bummer!), and I discovered this from other mechanisms along the way – I’ll spare you the exact details.

What I did discover is that I was occasionally getting PHP warnings that did not line up with the PHP settings for v8.3 profile that were on the server. So I was setting the (already set) version 8.3 of PHP once again for that account and it would be fixed, only to become a problem again later. This was actually happening for both the J4 site (terribly minor issue) and the J5 site (big time orange-bad issue).

It's now worth mentioning at this point that this is a longstanding server and for various reasons I had the “system default” still set to PHP 7.3 and was manually overriding for anything else. I mean, it worked, right?

It then dawned on me as to what has happening.

For some likely buggy reason, even though I had the individual account PHP set to 8.3 and this was recognised by the install process, there was somehow still a way or mechanism for that very same hosting account to deflect back to an older PHP version, especially when an alternative htaccess file was being used.

So the solution in the end was to manually allocate older PHPs to sites that still needed it for the time being, and make PHP 8.3 the new system default for the server. (Note for WHM admins, I also installed PHP-FPM for the PHP 8.3 profile in MultiPHP Manager and this enabled the new PHP default version setting to 'stick' properly.)

The change of system default (not just a per account manual selection) to PHP 8.3 has now fixed the issue.

Everything is hunky dory and Joomla is a beautiful thing.

PS. I remember back to the days of Andrew Eddie and others who first wrote Mambo which then in turn became Joomla as we know it. It’s amazing how this very mature open source software has continued to go from strength to strength. It really is an amazing and powerful thing.

Statistics: Posted by AndrewSmith — Fri May 17, 2024 8:53 am



Viewing all articles
Browse latest Browse all 2110

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>