You're taking it the wrong way I think.
AJAX sends a request from within the already running C2 app to an external script (php) and gets an answer in return. The script page you're trying to access shouldn't contain the c2runtime or anything.
So basicly from inside C2 you execute an ajax request to "yoururl.php?yourvariables", the script in "yoururl.php" processes the variables and return an answer to the app.
For the server side, it's PHP scripting.
Check the items listed in the "AJAX" section of the how do I FAQ there are complete working examples of communication between the app and serverside PHP.