Subversioned PHP Project

software development

#1

Hello!

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.


#2

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


#3

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.


#4

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:

http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.reposadmin.create.hooks

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

updatesite.php:
[php]

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

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