Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to make my UnitTests available to see via the browser.

My directory structure looks like this:

application
docs
public
 - index.php
tests

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

2 Answers 2

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

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
</Directory>
share|improve this answer

Your Answer

 
discard

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.