php scripts run at command prompt

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thein
Forum Newbie
Posts: 1
Joined: Fri Jan 24, 2003 9:33 am

php scripts run at command prompt

Post 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
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post 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.
Post Reply