[clue-tech] Apache returning text of PHP script

Jed S. Baer cluemail at jbaer.cotse.net
Sun Jan 17 13:58:25 MST 2010


Hi Folks.

Just trying to get the CLUE website migrated over to a new VPS instance.
Some differences:

Old server
  httpd-2.0.52-41.ent.6.centos4
  php-4.3.9-3.26

New server
  httpd-2.2.3-31.el5.centos.2
  php-5.1.6-24.el5_4.5

When the Apache server processes a GET request with a URL of '/', it
returns the text of index.php with a mime-type of x-http-php.

When it processes a GET request with a URL of '/index.php', it returns
the HTML content generated by index.php, all good.

I've been tweaking config items having to do with directory indexes and
php, to no avail. Can't figure what's different about serving index.php
implicitly as a result of resolving / via directoryindex, and explicitly.

FWIW, here's relevant lines from the httpd.conf

<Directory "/usr/local/www/clue/public_html">

  Options FollowSymLinks
  AllowOverride AuthConfig
  AddType application/x-httpd-php .php .html
  DirectoryIndex index.php index.html
  ErrorDocument 404 /404.html
  Order allow,deny
  Allow from all

</Directory>

I've tried commenting out the AddType and DirectoryIndex lines -- doesn't
make any difference.

Also, in the Apache php.conf file, I've had this line:
#AddHandler php5-script .php .html
commented and uncommented, no difference. (On my home machine, with
apache2 and php5, there's no AddHandler line, and php works fine -- seems
unnecessary.)

Any thoughts on what would cause Apache (or php) to return the text of a
php script, instead of running it?

jed
-- 
Ok, so we should be thinking of a lovable, cuddly, stuffed penguin
sitting down after having gorged itself on herring. Still with me? 
 -- Linus Torvalds


More information about the clue-tech mailing list