[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox-cvs
Subject:    [Bug 13991] New: httpd doesn't serve index.php with 1.32
From:       bugzilla () busybox ! net
Date:       2023-03-09 21:58:01
Message-ID: bug-13991-161 () https ! bugs ! busybox ! net/
[Download RAW message or body]

https://bugs.busybox.net/show_bug.cgi?id=13991

            Bug ID: 13991
           Summary: httpd doesn't serve index.php with 1.32
           Product: Busybox
           Version: 1.32.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Networking
          Assignee: unassigned@busybox.net
          Reporter: hi@konstantin-schauwecker.de
                CC: busybox-cvs@busybox.net
  Target Milestone: ---

I have upgraded a system that was previously running 1.29.2 to busybox 1.32.0.
The system is running httpd and the index file name is set to index.php, with
the php interpreter configured for all *.php file.

Since the update, it's not possible to access any php files without explicitly
writing "index.php" in the URL. Example:

http://my-ip/index.php works on both systems
http://my-ip/ only works on 1.29.2

I get a 404 error and the following log:

[::ffff:192.168.10.5]:60708: can't execute '': No such file or directory
[::ffff:192.168.10.5]:60708: response:404

My httpd.conf file is:
=============

*.php:/usr/bin/aarch64-linux-php-cgi
I:index.php
h:/var/www

# Mime types
.pdf:application/pdf
.yaml:text/yaml
.js:text/javascript

--- Comment #1 from KS <hi@konstantin-schauwecker.de> ---
I found a work-around for this issue. I created a cgi-bin/index.cgi file with
the following content:
------

#!/bin/bash

php_name="/var/www/$REQUEST_URI/index.php"

if [[ -f $php_name ]]; then
        export SCRIPT_FILENAME=$php_name
        cd `dirname $php_name`
pwd
        aarch64-linux-php-cgi
else
        exit 1
fi

--- Comment #2 from Vex Mage <z@dosmage.net> ---
I'm having this problem too on version 1.34.1, although I'm using ph7 not php.
Here's my script I wrote to workaround the issue. It, hopefully, preserves any
query string and redirects sub directories. I'm certain there are bugs.


/etc/httpd.conf
H:/var/www
I:index.php
A:*
*.php:/usr/bin/ph7


/var/www/cgi-bin/index.cgi:
#!/bin/sh
REDIRECT_URI=`echo ${REQUEST_URI} | awk -F? '{ print $1 }'`
REDIRECT_QUERY=`echo ${REQUEST_URI} | awk -F? '{ print $2 }'`

if [ -e $REDIRECT_QUERY ] ; then
  REDIRECT_PATH=${REDIRECT_URI}index.php
else
  REDIRECT_PATH=${REDIRECT_URI}index.php?${REDIRECT_QUERY}
fi

echo "Status: 307 Temporary Redirect"
echo "Location: ${REDIRECT_PATH}"
echo ""

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
busybox-cvs mailing list
busybox-cvs@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic