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
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
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 ""