Re: scripting with php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bruno Santos wrote:
> i'm working with php for about 3 years and i must say: i cant get tired
> of it !! :-)
>
> since my first page, ive used php as a server side language, embebed in
> html pages. now, i need to develop a small script to run as stand alone.
> how can i do it ?
>
> just like bourn shell, ive used #!/usr/bin/php -q, but it apears is not
> working ...
>
> can someone tell me how to i use php stand alone ?
> chears !!!


'shell> ' indicates something you type at a Un*x/MS-DOS shell prompt.



Step 1.
Confirm that /usr/bin/php is there, and working:
shell> /usr/bin/php -v

Either this outputs PHP's version number, or you don't have PHP installed
at /usr/bin/php.

Step 2.
Make sure your script works, *without* the #!/usr/bin/php -q line in it.
shell> php -q YOURSCRIPT.php

Either this script does what you expect, or the script isn't right.
Did you put <?php ?> in there?  Yes, you need to put <?php ?> in there.


Step 3.
Make sure your PHP shell script is executable:
shell> chmod 744 YOURSCRIPT.php

Change YOURSCRIPT to the name of your script, of course.

Step 4.
Put the #!/usr/bin/php -q back in there and try it
shell> ./YOURSCRIPT.php

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux