Well, I've spent the last two days trawling through the configs, disabling bits, modifying bits, and it still ends up with the same result as before; PHP scripts offered as downloads (NOT just simply disabled in the browser)..

Interestingly, if I try to access a php file directly it offers it as a PHP File download, but if I try and access domain.co.uk it'll offer it as a "application/x-httpd-php" download..

I've stuck all my configs on pastebin for analysis, I've really exhausted all I can try and there's only so much reading into a problem and tweaking config files you can do before you have to admit you need help;

(listed in the order in which they are read)

/etc/httpd/conf/httpd.conf - http://apache.pastebin.ca/668977
/etc/httpd/conf.d/fcgid.conf - http://apache.pastebin.ca/668983
/etc/httpd/conf.d/localhost.conf - http://apache.pastebin.ca/668984
/etc/httpd/conf.d/mailman.conf - http://apache.pastebin.ca/668986
/etc/httpd/conf.d/manual.conf - http://apache.pastebin.ca/668987
/etc/httpd/conf.d/perl.conf - http://apache.pastebin.ca/668988
/etc/httpd/conf.d/php.conf - http://apache.pastebin.ca/668989
/etc/httpd/conf.d/python.conf - http://apache.pastebin.ca/668990
/etc/httpd/conf.d/ssl.conf - http://apache.pastebin.ca/668991
/etc/httpd/conf.d/stats.conf - http://apache.pastebin.ca/668992
/etc/httpd/conf.d/suphp.conf.disabled - http://apache.pastebin.ca/668994
/etc/httpd/conf.d/webalizer.conf - http://apache.pastebin.ca/668995
/etc/httpd/conf.d/zz010_psa_httpd.conf - http://apache.pastebin.ca/ 668999 /var/www/vhosts/domain.co.uk/conf/httpd.include - http:// apache.pastebin.ca/669001 /var/www/vhosts/domain.co.uk/conf/vhost.conf - http:// apache.pastebin.ca/669002

For the purpose of security all IP addresses, domain names and hostnames have been replaced by server_ip, domain.co.uk and hostname.location.domain.co.uk respectively. When I an testing suPHP I am renaming php.conf to php.conf.disabled and suphp.conf.disabled to suphp.conf.

I would be most appreciative if you could vet these configs,

Kind regards,

On 22 Aug 2007, at 15:56, Jeremy Chadwick wrote:

On Wed, Aug 22, 2007 at 03:38:31PM +0100, Jason Bhalla-Gaunt wrote:
I literally added those 4 (well, 5 including the comment) lines to the conf and it didn't work, still the same presenting it as a download result.

The relevant configuration lines you provided here were:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Compare this to:

AddType application/x-httpd-php .php
AddHandler x-httpd-php .php

Do you see the difference?  Notice the missing AddHandler.  Without
this, suphp isn't going to get called.

The AddType just adds the appropriate MIME type for PHP documents; this,
would cause some browsers to offer the PHP script as a download, since
no actual parser is being executed on it prior.

An incorrect AddType (e.g. removing "application/", which I'm sure you
did because there's a bazillion websites on Google which talk about how
"this worked great for me", despite the administrator having no idea
what they're doing, nor had they looked in mime.types to see what the
proper syntax was) would cause the browser to default to render as
text/plain, e.g. the PHP script would simply display in the browser.

Sorry if I sound bitter or rude, but this is a common thread here, and
most of the time it ends in the same way -- someone's server having
"mysterious" configurations that the admin overlooked day after day,
lots of hand-holding, and then becoming reliant on websites written by
random Internet jhonkas running Apache.  :-)

What I'm trying to say is: it really helps if you slow down and learn
what it is you're working with / learn what it is you're doing, rather
than just pounding keys, making it work, and thinking it's magical.

--
| Jeremy Chadwick jdc at parodius.com | | Parodius Networking http:// www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |


!DSPAM:1,46cc4f48318342092888793!



___________________

Jason Bhalla-Gaunt
+44 (0)121 233 4838 (Direct Dial)
+44 (0)121 200 2627 (Main Line)

Made Media Ltd
105 Carver St, Birmingham B1 3AP
http://www.mademedia.co.uk/
Registered in England & Wales: 4530365

___________________


_______________________________________________
suPHP mailing list
[email protected]
http://lists.marsching.biz/mailman/listinfo/suphp

Reply via email to