| Summary: | httpd doesn't serve index.php with 1.32 | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | KS <hi> |
| Component: | Networking | Assignee: | unassigned |
| Status: | NEW --- | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.32.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
KS
2021-07-09 18:04:14 UTC
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 ""
|