Subversioned PHP Project

software development



I am using an SVN repo to keep a php project up to date and hosted on one of my DH domains.

Unfortunately, when I navigate to the directory the source code is displayed instead of running the PHP script. Even the .phtml files are showing source instead of rendering.

Is this because its in a repo? I would really appreciate any help in getting this to work without having to manually copy files using the webftp thing.


Correct. Files stored in Subversion repositories are always delivered “raw”. You will need to check the repository out to your domain.


Thanks a lot.

I knew there must be a way, because I used a subversion repo in a team project a couple years ago in school and one of the team members was hosting the project on his domain and we didn’t have problems.

[EDIT] How do I checkout to the domain? If it helps, I’ve got a shared hosting account.


If you want completely automatic mirroring of the repository and site, then you could add a post-commit hook script that updates/checks-out the live web-directory for your site:

Alternatively you could have a page that updates the site when loaded. A sketch:


<?PHP system('svn update ~/', $retval); ?>

Result Code: <?PHP echo $retval ?>[/php]