First, I'd set the Apache ErrorLog directive for the testdomain to a separate log file in /var/log/apache2 if you haven't done so already. I usually just "tail" this file in a terminal window while debugging the website code. However if you want to enable the display of error messages within the page, add these to the top of your index.php script:
All my PHP sites include an initialization script before any content is displayed, so I would put these commands in that. Otherwise you need to put them at the top of index.php and any other .php pages.
In versions of PHP starting with 5.2.4, you would replace '1' with 'stdout' in the ini_set() function.