Re: [PHP] scripting with php

2004-12-15 Thread Richard Lynch
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


Re: [PHP] scripting with php

2004-12-14 Thread Robert Cummings
On Tue, 2004-12-14 at 16:38, Bruno Santos wrote:
 Hello all.
 
 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 !!!

Use:

#!/usr/bin/php -qC

The C flag makes it the working directory for the script the same one as
your are in when you invoke it. Also ensure that your PHP binary exists
at the specified path. Last but not least you still need the opening PHP
tag:

?php 

Put it right after the first line (the binary specification header).

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] scripting with php

2004-12-14 Thread Bruno Santos
Hello all.
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 !!!
Bruno Santos
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] scripting with php

2004-12-14 Thread Christopher Fulton
one more note...you may look at the manual under

http://us3.php.net/features.commandline

-Chris


On Tue, 14 Dec 2004 16:04:15 -0800, Christopher Fulton
[EMAIL PROTECTED] wrote:
 Not sure if this is what you want, but i know that you can call php
 from a command line by using.
 
 php code_name.php
 
 that will print out the http headers, so to supress the headers you can do
 
 php -q code_name.php
 
 Hope this helps,
 Chris
 
 
 On Tue, 14 Dec 2004 21:38:18 +, Bruno Santos [EMAIL PROTECTED] wrote:
  Hello all.
 
  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 !!!
 
  Bruno Santos
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



Re: [PHP] scripting with php

2004-12-14 Thread Marek Kilimajer
Bruno Santos wrote:
Hello all.
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 !!!
It must work. What error do you get? Remember php code must be enclosed 
in ?php ?

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


Re: [PHP] scripting with php

2004-12-14 Thread Christopher Fulton
Not sure if this is what you want, but i know that you can call php
from a command line by using.

php code_name.php

that will print out the http headers, so to supress the headers you can do

php -q code_name.php

Hope this helps,
Chris


On Tue, 14 Dec 2004 21:38:18 +, Bruno Santos [EMAIL PROTECTED] wrote:
 Hello all.
 
 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 !!!
 
 Bruno Santos
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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