Page 1 of 1

php scripts run at command prompt

Posted: Fri Jan 24, 2003 9:33 am
by thein
I want to run php at command prompt in linux like
#>php script.php
But php is not configured like the apache modules which run fine in a browser. What can I do to make php in shell mode work the same as one in the browser. We need it to run applications in cron jobs. If I run
#>php info.php
where info.php is
<? phpinfo(); ?> I get diffrent outcome than from the same file in a browser. How can I get them to work the same

Posted: Fri Jan 24, 2003 10:02 am
by mydimension
could you be a bit more specific about the differences you are experiencing? if the difference is only in what you see for output then both instances are doing exactly what they are supposed to do. the php engine outputs an html stream. when run from the server this stream is sent to the browser and the browser renders the html for display. when run from a command prompt this stream is displayed as simple text.