PHP CGI 4.3.2 + suExec Apache Patch

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris S

    PHP CGI 4.3.2 + suExec Apache Patch

    Hi,
    I have been running PHP as a CGI for a few months now (using suExec
    patch @ http://www.localhost.nl/patches/apac...-suexec-patch).
    I decided to upgrade to version 4.3.2 (from 4.3.1). I configured 4.3.2
    exactly the same as 4.3.1 using ./configure --with-mysql --enable-cgi.
    I did a make install and then copied the /usr/local/bin/php to
    /usr/local/bin/php4.cgi as that is what the suExec patch is expecting.
    After replacing the 4.3.1 binary w/ the 4.3.2 binary all scripts
    executed return a "No input file specified" error message, which means
    for some reason the executable isn't receiving the argument of the
    script to execute. The strange thing is that if I copy the 4.3.1
    binary back everything works properly. Here is the relevant code
    regarding suexec.c w/ some debugging changes by me.
    if (usephp) {
    newargv[0] = phphandler;
    newargv[1] = cmd;
    newargv[2] = NULL;
    }
    ....snip....
    log_err("argv0: %s argv1: %s cwd:
    %s\n",newargv[0],newargv[1],cwd);
    fclose(log);
    log = NULL;
    execv(newargv[0], newargv);

    and here is the log output when a PHP script is called.
    [2003-07-08 10:09:03]: info: (target/actual) uid: (james/james) gid:
    (james/james) cmd: index.php
    [2003-07-08 10:09:03]: argv0: /usr/local/bin/php4.cgi argv1: index.php
    cwd: /home/james/website.net/3/ss

    Any help/pointers are appreciated.
Working...