I have a system that is currently running Redhat 7.3, and has the
default Apache 1.3.x and PHP 4.1.x RPM's installed. We also have suexec
enabled for CGI's. I would like to create a suexec PHP-CGI for a single
VHOST. I compiled a standalone CGI PHP system with the following
configure line:
'./configure' '--enable-force-cgi-redirect=yes'
'--enable-memory-limit=yes' '--enable-safe-mode=no'
'--enable-sysvsem=yes' '--enable-sysvshm=yes' '--with-gd'
'--with-jpeg-dir=/usr/local' '--with-zlib' '--enable-wddx'
'--enable-calendar' '--enable-ftp' '--with-db'
'--enable-gdbm=/usr/local/lib' '--with-mysql'
'--with-config-file-path=/etc/'
'--with-include-path=/home/USER/php/include/'
I coped the resulting php executable (from sapi/cgi/php) to my cgi-bin
directory (/home/sites/myconid.com/cgi-bin), and made the following
.htaccess in my webroot (/home/sites/myconid.com/html):
Addtype application/x-cgiphp .phpcgi
Action application/x-cgiphp /cgi-bin/php
I then made a php.phpcgi file that has the following:
<?
echo "<BR>\n";
echo passthru("/usr/bin/whoami");
echo "<BR>\n";
phpinfo(); ?>
The resulting HTML is:
Content-type: text/html
X-Powered-By: PHP/4.3.0
<br>myconid
<br><br><br><br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html><head>
<style type="text/css"><!--
body {background-color: #ffffff; color: #000000;}
If I telnet to the server and request the file I get:
[sbrinker@host243 php-4.3.0]$ telnet www.myconid.com 80
Trying...
Connected to host.
Escape character is '^]'.
GET /php.phpcgi HTTP/1.1
Host: www.myconid.com
HTTP/1.1 0
Date: Fri, 03 Jan 2003 17:33:43 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12
OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26
Transfer-Encoding: chunked
Content-Type: text/html
e
Content-type:
9
text/html
2
17
X-Powered-By: PHP/4.3.0
2
2
4
<br>
Im not sure where thoes extra bits are comming from (e,9,2 etc), however
they do not show up in my browser. The second Content-type and on do
show up howerver. Is there something I can do to avoid this second
Content-type?
Thanks
--
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php