Re: php4 as a module AND a cgi

From: Date: Mon, 26 Feb 2001 23:37:41 +0000
Subject: Re: php4 as a module AND a cgi
Groups: php.general 
Request: Send a blank email to php-general+get-41760@lists.php.net to get a copy of this message
Addressed to: <frodo@interport.net> php-general@lists.php.net ** Reply to note from <frodo@interport.net> Mon, 26 Feb 2001 15:58:19 -0500 > > hi all, > > thanks for the replies. many of you asked why I want to use php4 as a cgi. > > basically it boils down to this, using PHP as CGI you can run PHP > scripts via cron tab, which eliminates the need for shell scripting > (yeah baby). In that case, compile php without using with-apache or with-apxs to create a php binary. Place it in /usr/local/bin or someplace in your path. There is a way to run php from cron something like: /usr/local/bin/php -q script-name.php The way I do it is a little different. In cron I specify: /path/to/php/script.php In the top of script.php, I add a special first line: -------------------------------- #!/usr/local/bin/php -q <? phpinfo(); ?> -------------------------------- The important thing to remember here, it has NOTHING to do with Apache or CGI, you are using standard shell operations to allow php to execute scripts the same way most perl scripts, and a lot of other scripts are run. Rick Widmer Internet Marketing Specialists http://www.developersdesk.com

« previous php.general (#41760) next »