chrithccmc chrithccmc - 1 year ago 99
Bash Question

running php script (php function) in linux bash

How we run php script using linux bash ?

php file test.php

test.php contain.

<?php echo "hello\n" ?>

Answer Source

From the command line enter this: php -f filename.php

Make sure that filename.php both includes and executes the function you want to test. Anything you echo out will appear in the console including errors.

Be wary that often the php.ini for Apache PHP is different from CLI PHP (command line interface).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download