PHP as CGI
| From: | Nils Hoven | Date: | Thu, 14 Feb 2002 21:16:21 +0000 |
| Subject: | PHP as CGI | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-6012@lists.php.net to get a copy of this message | ||
Hi there!
pardon me if this has been covered amillion times; I'm new to this
newsgroup, so I haven't been following it for ages; plus, I browsed the
archives and couldn't really find a solution to my problem.
I'm trying to make PHP work with apache as CGI. My system at home is a
linux system with SuSE 7.2 (apache as rpm), and at work I'm trying it on a
SPARC with Solaris 5.8 and self-compiled apache.
I've successfully compiled PHP as executable without problems; it works
fine on the command line, so I guess the compiling was successful.
Now I'm trying to teach apache to use it. I've RTFM and added the following
to my httpd.conf:
---snip---
ScriptAlias /php-cgi/ /usr/local/httpd/php-cgi/
Action application/x-httpd-php /php-cgi/php
AddType application/x-httpd-php .php
---snip---
that's what I found all over the web how to do it. I've copied my compiled
php to /usr/local/httpd/php-cgi/ and made a chmod 755 to it.
Now, when I call the famous Hello World script (hello.php)
---snip---
<?
print "Hello World";
?<
---snip---
like "http://www.blah.com/hello.php"
(assuming the php file is in the doc
root) I get the following error message:
"Parse error: parse error in /usr/local/httpd/php-cgi/php on line 3806"
What's this? what am I missing? As I said... I can call php on the shell
prompt, it's output looks perfect. What's wrong here?
oh, for the record: here's my ./configure for php:
./configure --without-apache --enable-force-cgi-redirect
--enable-discard-path --enable-ftp --with-gd --enable-trans-sid
--with-gnu-ld
Can anyone here help me out?
Thanx!