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 would like to make my UnitTests available to see via the browser.

My directory structure looks like this:

 - index.php

My DocumentRoot is in the public folder. However, when I try to add an alias /source to my Apache configuration and set add the type php-source to the .php files (instead of just .phps) Apache still tries to execute the files.

Is there a smart way to do this?

share|improve this question

This is the solution I found:

Alias /test "/var/www/api_dev/tests"
<Directory "/var/www/api_dev/tests/">
     AddType application/x-httpd-php-source .php
share|improve this answer

Easiest way, is simply rename/copy the file to a .phps extension.

The MIME type should already be in place and you should be ready to go.

  • Mime:text/html
  • Mime:application/x-httpd-php-source
  • Mime:application/x-httpd-php3-source
share|improve this answer
The problem with this is: I want the visitor to see my Unit tests that I also run to check my code. So I can't just rename the files to .phps. – Sebastian Hoitz May 18 '11 at 5:57

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.