Results 1 to 3 of 3
what the command should i use to run script file from command line?...
- 06-11-2008 #1Just Joined!
- Join Date
- Apr 2008
- Posts
- 38
run php from command line
what the command should i use to run script file from command line?
- 06-11-2008 #2
If you have PHP installed use the command:
where <php script> is the name of the PHP script you would like to run.Code:php <php script>
Linux User #453176
- 06-12-2008 #3Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,117
Hi.
You can use:
Producing:Code:#!/usr/local/bin/php <?php # @(#) s1 Demonstrate one way to call php. // @(#) s1 Demonstrate one way to call php. print "\n"; print " Hello, world from php.\n"; print "\n"; ?>
Noted by:Code:% ./s1 Hello, world from php.
cheers, drlYou can use a shebang line to automatically invoke php from scripts.
Only the CLI version of PHP will ignore such a first line as shown
below:
#!/bin/php
<?php
// your script
?>
-- excerpt from man php on a FreeBSD 6.2-RELEASE-p1 systemWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )


Reply With Quote