How to exec PHP as CGI
| From: | Lowell Allen | Date: | Wed, 27 Aug 2003 20:49:02 +0000 |
| Subject: | How to exec PHP as CGI | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-160959@lists.php.net to get a copy of this message | ||
My PHP script for updating some static HTML pages no longer works on a
commercial host that changed their setup so PHP can't write files to the
public_html directory. The host's tech support says that a PHP script
executed as a CGI can still write to public_html.
The site has PHP 4.3.2 on Apache 1.3.28, with passthru, shell_exec, and
system disabled. I'm not sure how to approach converting my script to work
as a CGI -- if I need to execute the update from a content management system
link, do I use exec()? Does exec() take a Unix command? If so, would that
command just reference my PHP script headed with "#!/usr/bin/php -q"? And
how do I return something to tell me if execution was successful?
I'm searching through the manual, but links to good examples (or outright
explanations) would be greatly appreciated.
--
Lowell Allen