Joomla Installations using SEF with Suexec

I have an interesting and very specfic issue.

I host joomla for the most part, and will soon have a large number of sites, but currently Only have 2 sites hosted.

The issue im having is that joomla has an SEF option, creating search engine friendly urls.

Phase one is to use these urls in the format of these are then interpreted by the framework and re assembled into a standard url with query.

Phase two of the SEF is to create urls such as

Phase 2 uses mod_rewrite to remove index.php

My issue is that when using suexec (FCGI wrapper) something is getting screwed up somewhere, as none of my external css files or javascript files are loading. (They are referenceing domain.tld/index.php/css/main.css etc) This only happens using the phase one type sef, and it is not really an option to change it as all our search engine rankings are based on the phase one format.

You can see this live by going to navigateing to any of the pages(except home) and add

When i use mod_php instead of fcgi everything wqorks as expected (Aside form permission issues)

My system is Virtualmin GPL 3.79, Ubuntu 10.04, Webmin 1.517
I have had to follow the instruction at to get fcgi working to start with.

Any help is appreciated.

Regards Cole.


Yeah, I’ve seen PHP versions above 5.2.9 with CGI or FCGID have trouble with the SEF URL’s in Joomla.

One thing you might try doing is to edit $HOME/etc/php.ini, and set “cgi.fix_pathinfo=0”. That may end up correcting some or all of those issues.


Tried your suggestion,

Returned some very unusual (To me) results.

Firstly i tried your exact sugestion, and on first attempt it worked as expected. everything loaded as expected. On second attempt, I got a 500 Server error (From apache). I kept getting a 500 error on every page except the home page.

I removed the setting (Commented it) and back to the original issue. I tried again to see \if the problem was reproducable. and it isnt. I could not get a 500 error again.

after many retrys i concluded that the setting was making no difference to the actual output, so i left it commented and out of interest check the public_html/php5.fcgi file and it reads {code}#!/bin/bash
export PHPRC
umask 022
exec /usr/bin/php5-cgi
(I dont know if code tage work)

This appears to reference the php5 folder in etc, after looking there i found another php.ini file.

This file already had cgi.fix_pathinfo=0 so i changed it to ‘1’ to see what would happen.

Looking at the page was half working. it appears all the css has loaded but various scripts and images were missing. every refresh provided different images missing. navigating to another page from that page provided the following url. and it kept getting longer.

So ive set everything back to the way it was now.

your website seems to work now. i didnt see oddities

The site is a live site that currently gets a fair bit of traffic, and is well indexed by search engines, therfore this issue is quite important to me, and the site is not viewable at all when fcgi is used, so mod_php is enabled until i have a resolution that works.

what is in your .htaccess ?

.htaccess attached. It is standard Joomla htaccess.

EDIT: If it would help to see the affects i can arrange to demonstrate.

EDIT: is also experiencing the same affects as I have just noticed.

And also, this type of SEF does not require the use of .htaccess, Healthfusion does not have one.

you can try commenting out followsymlinks as that is set in your apache config normally.
however Im running 30+ joomla site with fcgid and all without issues.

you are not running sef from a 3rd party component, but the default joomla sef yes?

so your php.ini file or vhost conf may need to be tweaked.
i would like to see them too and Ill have a look tomorrow, its too late here now…

Ok, I will work with from now on as it is less critical.

It has no .htaccess.

Attached VHost.conf

Attached $Home/etc/php5/php.ini

I am also interested to know what platform you are running on? Note that I am using Ubuntu 10.04… I think so far its been more trouble than its worth.

EDIT: PHP.ini has cgi.fix_pathinfo=0 set as per recomendation above. On this site (Healthfusion) images are loading but css and text are not.

EDIT (AGAIN): So i found a solution, making this less of an issue. If I provide a ‘live_site’ value in joomla’s config.php the JURI::base() method uses that instead of calculating. This will work as long as all paths are correct interpreted using JURI class. Relative paths will potentially still be an issue. i changed this back ‘cgi.fix_pathinfo=1’

And Another Edit: Have had to disable fcgid again as every-time i upload anything of decent size, seems 100k is about the limit, it gets corrupted. An example is installing extensions

I still believe this is an issue though, as I have never had to set Joomla’s live site variable before.

i dont actually see strange stuff in your attached files.
I run only CentOs 32 and 64 bit servers, all without a hassle.

I know too little of Ubuntu server to be able to really help, I just use it as a desktop.

Which SEF are you using, if any?

I’m running CentOs, too, and looking to go back to *CGI from mod_php, because of the permissions issues.

I’ve been using AceSEF, and found it pretty good.