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?


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

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
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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