Bug #74773 [NEW]: Wrong SCRIPT_NAME with Tomcat and CGIServlet
| From: | jan0michael at yahoo dot com | Date: | Sat, 17 Jun 2017 14:26:12 +0000 |
| Subject: | Bug #74773 [NEW]: Wrong SCRIPT_NAME with Tomcat and CGIServlet | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209564@lists.php.net to get a copy of this message | ||
From: jan0michael at yahoo dot com
Operating system: Linux Debian 8.8,Tomcat 9 M21
PHP version: 5.6.30
Package: Servlet related
Bug Type: Bug
Bug description:Wrong SCRIPT_NAME with Tomcat and CGIServlet
Description:
------------
I try to run nextcloud using Tomcat. In the configuration for the
CGIServlet I set /usr/bin/php5 as executable.
I connect my web browser to 127.0.0.1:8086/nextcloud/index.php.
This executes /usr/bin/php5 /var/www/default/nextcloud/index.php.
The CGIServlet sets the environment variable SCRIPT_NAME correctly to
/nextcloud/index.php, but the php interpreter changes the variable to
/var/www/default/nextcloud/index.php, what makes nextcloud throw an
exception.
I found no way to prevent php from changing SCRIPT_NAME, and using the
already set value instead.
Test script:
---------------
What I think how the CGIServlet should be configured in web.xml:
<servlet>
<servlet-name>php-cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>executable</param-name>
<param-value>/usr/bin/php5</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>php-cgi</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>
--
Edit bug report at https://bugs.php.net/bug.php?id=74773&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74773&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74773&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74773&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74773&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74773&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74773&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74773&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74773&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74773&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74773&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74773&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74773&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74773&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74773&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74773&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74773&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74773&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74773&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74773&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74773&r=mysqlcfg