The ajaxpage function performs a GET request with no headers. Aside from any syntax errors you may or may not have in the code - you haven't shown the exact code that gives that error, you might need to be sending a POST or other type of request which requires a header.
Like in PHP, I would put:
or whatever, even much more complex PHP code like to write to/read from a file or database, on a separate page, say call it - hello.php, then use ajaxpage to fetch that:
<?php echo 'Hello World'; ?>