Environment variables in PHP 5.1.4

From: Date: Thu, 12 Oct 2006 19:26:26 +0000
Subject: Environment variables in PHP 5.1.4
Groups: php.install 
Request: Send a blank email to php-install+get-17695@lists.php.net to get a copy of this message
All, I'm having some problems with a PHP 5.1.4 installation I did on a Solaris 8 box when I try to use it with CGIwrap. I've narrowed the problem down to a couple of environment variables when, if both are set, causes PHP (called in CGI mode by CGIwrap) to claim that no input file is specified. The build of PHP 5.1.4 was done thus: ./configure --prefix=/usr/local/php5 --with-ldap=/usr/local \ --enable-discard-path --disable-force-cgi-redirect --disable-cli \ --with-mysql=/usr/local/mysql5 --with-gd --with-jpeg-dir=/usr/local \ --with-zlib --disable-pear --with-xsl=/usr/local CGIwrap, essentially, su's to a specified UID, sets environment variables (SCRIPT_FILENAME, etc.), and calls /usr/local/bin/php. This works perfectly well except in instances where both PATH_TRANSLATED and REDIRECT_URL are both set -- in those cases, PHP claims "No input file specified." PHP 4.3.9, which we were running until we upgraded to 5.1.4, doesn't display this behavior -- with identically-set environment variables, PHP4 will properly find and execute the script where PHP5 won't. To give more of a concrete example of the way the environment variables are set, the following is an example of a set which *does* execute properly in PHP5.1.4: ------------------------------------------------------------------
     QUERY_STRING: ''
      SCRIPT_NAME: '/cgi-bin/cgiwrapd/testuser/index.php'
SCRIPT_FILENAME: '/opt/apache/htdocs/testuser/cgi-bin/index.php'
     REDIRECT_URL: '<NULL>'
        PATH_INFO: ''
PATH_TRANSLATED: '/opt/apache/htdocs'
      REMOTE_USER: '<NULL>'
      REMOTE_HOST: '<NULL>'
      REMOTE_ADDR: '111.111.1.111'
------------------------------------------------------------------ However, setting the environment variables as follows causes a "No input file specified" error: ------------------------------------------------------------------
     QUERY_STRING: ''
      SCRIPT_NAME: '/cgi-bin/cgiwrapd/testuser/index.php'
SCRIPT_FILENAME: '/opt/apache/htdocs/testuser/cgi-bin/index.php'
     REDIRECT_URL: '/testuser/cgi-bin/'
        PATH_INFO: ''
PATH_TRANSLATED: '/opt/apache/htdocs'
      REMOTE_USER: '<NULL>'
      REMOTE_HOST: '<NULL>'
      REMOTE_ADDR: '111.111.1.111'
------------------------------------------------------------------ The output above is provided by CGIwrap run in debug mode, but I've set the environment variables the same way at the command line and then run the PHP CGI, with the same results. Again, PHP4.3.9 works for all these examples. I'm not sure if I've explained the problem properly nor given enough information to help solve it. I'm not even sure it's an installation question -- I'm kinda hoping that there's a switch I've set improperly during the 5.1.4 build which is causing the weirdness I'm seeing. Any suggestions are welcome, and of course I'll provide clarification if such is needed. Thanks for your time. --Joe ----- Joe Formoso (jformoso@stevens.edu), Senior Systems Administrator, IT Department, Stevens Institute of Technology

« previous php.install (#17695) next »