If you want to test some PHP code without using the browser interface, you can create a script to use command line shell as follows. Let us call this script scripting.php. Under Linux, create this file with the php extension and specify the executable path:
#!/usr/bin/php -q echo 'Hello';
Change the mode to executable:
chmod 755 scripting.php
and run it :
It should work if your PHP is already well configured.