You can run php scripts without apache. You can just run the script at the shell prompt. You may want to run it with the '-q' option to remove the html header tags.
# php -q script.php
The below script to print "hello world" will look different depending on whether or not you use this option.
PHP Code:
<?
print "Hello World! \n"
?>
This script without the '-q' option would produce the following output:
================================
X-Powered-By: PHP/4.0.5
Content-type: text/html
Hello World!
================================
While, using the '-q' option would only produce this:
================================
Hello World!
================================