Simple you changed
PHP Code:
After commenting out the lines:
// chdir('/path/to/forums/');
to the wrong url hence all the errors with the long url. In your admin cp scroll down to the bottom left under the maintanance section and click on PHP INFO.
In there it will show you the url you need. For instance mine is
/home/general/public_html/forum/
Its under the Enviroment section of the PHP info.
Hope it helps.