Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I migrated WP to a CentOS VM and I'm trying to setup pretty URLs.

My first move is to edit the conf file:

vi /etc/httpd/conf/httpd.conf

Under the appropriate tag:

<Directory "/var/www/html">

And set AllowOverride from None to All:

AllowOverride All

As soon as I change that setting, I get errors on all the admin pages:

Not sure if this belongs on the WP forum or some other forum. Thanks in advance.

I should also add that my hostname is the IP address. I'm not sure yet how to change it on a local VM.

This is what my .htaccess file in my DocumentRoot looks like:

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress
share|improve this question
up vote 1 down vote accepted

The screenshot you show looks like your server is not parsing the PHP code, but instead is displaying it on the screen. Are you sure PHP is properly setup?

EDIT: As per the answer I found in the comments below, the issue lies with the following line in your .htaccess file:

AddHandler application/x-httpd-php5s .php

You need to comment it or remove it, as it's telling Apache to override the PHP handler for your site with the one you specify, and it probably doesn't exist on your new server.

share|improve this answer
I know, I posted twice out of desperation. If I set AllowOverride to None, then the PHP gets parsed correctly. – AlxVallejo Feb 20 '12 at 13:55
Could you post the content of your .htaccess file(s) please? It's clearly something to do with that then... – Yanick Girouard Feb 20 '12 at 18:21
Sure. I wouldn't know that it was a .htaccess issue. I know that when I run phpinfo(), mod_rewrite is listed under loaded modules. Although, I'm not sure where it's listed in the httpd.conf file. – AlxVallejo Feb 20 '12 at 18:40
Try commenting out this line in the .htaccess file: AddHandler application/x-httpd-php5s .php This is telling apache to use a different php module to run the page, could be what's screwing it up! – Yanick Girouard Feb 20 '12 at 22:41
Didn't work. Although, restarting Apache did produce this error: "httpd: apr_sockaddr_info_get() failed for localhost httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName – AlxVallejo Feb 20 '12 at 22:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.