Re: php4 as a binary
| From: | Richard Lynch | Date: | Tue, 12 Dec 2000 05:17:42 +0000 |
| Subject: | Re: php4 as a binary | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29820@lists.php.net to get a copy of this message | ||
> I have a customer whos server I've been running php3 on unix with apache.
> I need to run some scripts that require php4, but at this time they only
> offer php4 as a binary in my cgibin. Thats all the info I was given. I
did
> some looking around and found /usr/local/bin/php4. Is this the file they
> were referring to?
Almost for sure. Use "ls -als /usr/local/bin/php4" and see who owns it and
can execute it. If the user running Apache can execute it, you're set. (Or
if they said something about suExec, you might still be okay...)
> If so how do I utilize it? Is htaccess part of this
> solution? I have little experience running cgi scripts, so details would
be
> very appreciated.
Maybe -- Or maybe they just need to tell you which extension to use. Try
.php first -- then ask them if they've already defined a mime-type. Or try
to read their httpd.conf file if you can find it.
find / -name httpd.conf -print 2> /dev/null
and take a coffee break. (Leave off the 2> /dev/null if you get no output
at all.)
If you do need to use .htaccess add these lines to a file named .htaccess in
your web-root directory:
AddType application/php4cgi .php4
Action application/php4cgi /usr/local/bin/php4
NOTE:
You may want to use something other than php4 for your extension -- Just
change the .php above to .php or .php4cgi or whatever distinct extension
makes you happy. (Read on first, though)
If it turns out that the file you found was not the binary, change the
/usr/local/bin/php4 to something else.
You *may* need to *copy* that php4 to your own cgi-bin... I doubt it, but
maybe...
I chose the somewhat non-standard applications/php4cgi on purpose -- At some
point they may give you PHP 4 as a Module, and it will be less confusing to
have a distinct mime-type while you convert your files from this temporary
setup to the real thing... Or maybe you should use .php as an extension if
you are reasonably certain you will not be relying on
> Is this forum archived and searchable?
Yes. On several sites. http://php.net/links.php