2

I have an apache httpd 2.2 installation on windows 8 (using the installer, installed to C:/Program Files (x86)/Apache Software Foundation/Apache2.2) and a php 5.2 installation (using the .zip, installed to C:/php). None my php files are parsing - they just show up as plain text.

<?php
// Stop PHP from killing itself
set_time_limit(0);

// Log error messages
ini_set('display_errors', 'On');
ini_set('log_errors', 'true');
ini_set('error_log', 'error_log');

...etc.

My httpd.conf has all the necessary lines (I think)

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

(and at the bottom:)

PHPIniDir "C:/php"
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
<FilesMatch \.php$>
      SetHandler application/x-httpd-php
</FilesMatch>

And just to be safe, this is in mime.types:

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

I've also edited the php.ini (Only the extension_dir though) properly (I think). What am I missing?

3
  • Might be a silly suggestion but did you reload the configuration file?
    – MitziMeow
    Dec 24, 2012 at 23:00
  • @MitziMeow Yes, every time I edited it. I'd restart apache and also stop it and start it. Nothing.
    – JXPheonix
    Dec 25, 2012 at 1:14
  • Where is your localhost root folder. I highly doubt that C:\ is it. If your code is not in the webservers folder, then it will be parsed as a plain old text file. This may be confusing with .html files since they are loaded by the browser anyway and look at though the webserver is working correctly. Dec 27, 2012 at 6:36

1 Answer 1

0

You might need explicitly add the php version you are trying to handle by appending it to x-httpd-php

AddHandler application/x-httpd-php5 .php

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .