|
Posted by Andy Hassall on 09/19/06 20:21
On Tue, 19 Sep 2006 12:27:19 -0700, "deko" <deko@nospam.com> wrote:
>I need to test a script and want to do so on a Linux box (logged in via SSH from
>another machine).
>
>I tried creating a test script (called "test.php") like this:
>
>#!/usr/bin/php
><?php
> print "test";
>?>
>
>and tried running this from the command line like this:
>
>./test.php
>
>but nothing happens.
>
>I also tried this:
>
>./test > test.txt
>
>and the text in test.txt is this:
>
>X-Powered-By: PHP/4.2.2
>Content-type: text/html
But you said your script was called "test.php", not "test"?
WHat did you actually do? What files did you actually create?
>Why is "test" not appearing in the test.txt file?
>
>How do I get "test" to appear on my screen, rather than having to use test.txt?
>
>Do I have to redirect STDOUT? How do I do this?
Run "php -v".
What result do you get?
One of the advantages of PHP5 appears to be that you get a more sensible "cli"
version of PHP installed, rather than the "cgi" version that you get in PHP4.
The CGI version of PHP can be persuaded to be similar to the CLI version by
using the "-q" flag, which supresses headers.
"./test.php" should still have output the same thing.
4.2.2 is very, very old, though, so there are many, many unfixed bugs in it.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|