Re: Writing scripts that don't run on the web

From: Date: Thu, 21 Dec 2000 20:45:30 +0000
Subject: Re: Writing scripts that don't run on the web
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-31469@lists.php.net to get a copy of this message
Tom Harris writes: > This is probably a dumb question. > > I've been told it's possible to write a php script that can be run from the > shell like a perl script. You just have to have the first line point to > where php is installed. Now I've installed PHP as an apache module on a Red > Hat 6.2 box. Is it still possible to run php scripts from the shell, if so > what would be the most likely place its installed. I have this horrible > feeling I'm going to have to re-install php in CGI mode (given the disaster > the install as module was I really don't want to try uninstall the module > and then install php in cgi mode). Relax, you don't need to uninstall anything. :) You can have both quite happily living on the same system. You just need to build PHP one more time. Use exactly the same 'configure' line you used last time (if you didn't write it down, phpinfo() will give it to you), except leave out --with-apxs or --with-apache line. Without either of these lines, PHP will build an executable interpreter, which will be left in the php4 source directory and named 'php'. For instance, I have two scripts for configuring PHP: if I want to build an Apache module, I use this: ./configure \ --with-apxs=/usr/local/apache/bin/apxs \ --with-pspell \ --with-mysql=/usr \ --with-gd \ --with-xml \ --with-zlib \ --with-curl \ --with-sablot \ --with-iodbc=/usr/local \ --enable-wddx \ --enable-versioning \ --enable-sysvshm \ --enable-sysvsem \ --enable-sockets \ --enable-shmop \ --enable-debug ...whereas when I want a commandline interpreter, I use this: ./configure \ --with-pspell \ --with-mysql=/usr \ --with-gd \ --with-xml \ --with-zlib \ --with-curl \ --with-sablot \ --with-iodbc=/usr/local \ --enable-wddx \ --enable-versioning \ --enable-sysvshm \ --enable-sysvsem \ --enable-sockets \ --enable-shmop \ --enable-debug Hope this helps, Torben -- +----------------------------------------------------------------+ |Torben Wilson <torben@php.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben@netmill.fi| +----------------------------------------------------------------+

« previous php.general (#31469) next »