Sometimes SVN (subversion) gives this error when configuring a new repo with commit email messages. The problem is to do with the REPO/hooks/post-commit script not being executable.
The script may in fact work when one runs the post-commit script manually using, e.g.,
sudo -u www-data /var/lib/svn/REPO/hooks/post-commit /var/lib/svn/REPO 2
However, given the limited environment variables (including PATH) that are defined when Apache runs the post-commit script, it becomes necessary to explicitly include
#!/bin/bash at the top of the post-commit script. This solved it for me.