You are here: newbie: how to run php from command line? « PHP Programming Language « IT news, forums, messages
newbie: how to run php from command line?

Posted by deko on 09/19/06 19:27

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

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?

Thanks in advance.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация