faqts : Computers : Programming : Languages : PHP : Installation and Setup

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

32 of 37 people (86%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

Why can't I run php from command line?

Feb 24th, 2002 23:22
Philip Olson, Nathan Wallace, Charles Chan, Henrik Hansen, Richard Lynch


Because you compiled it as a "Module" of Apache, rather than as a
standalone binary (aka "CGI").  Recompile without --with-apxs or
--with-apache.
Ignore that last make install step, and just put the resulting php
binary some place in your path.  In otherwords, in shell do (in your
php4 source directory):
  ./configure;
  make;
At that point a binary named 'php' is created, use it as you wish.
For more information on running PHP on the commandline, see:
  http://www.php.net/commandline
  http://www.phpbuilder.com/columns/darrell20000319.php3?print_mode=1