php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81520 TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php
Submitted: 2021-10-12 06:34 UTC Modified: 2021-10-12 07:25 UTC
From: remi@php.net Assigned:
Status: Closed Package: Testing related
PHP Version: 8.1.0RC3 OS: Linux
Private report: No CVE-ID: None
 [2021-10-12 06:34 UTC] remi@php.net
Description:
------------
When php is installed with a command prefix, this one is ignored in run-tests.php

ex: installation tree

/usr/bin/php
/usr/bin/php-cgi
/usr/bin/zts-php

When running run-tests.php with /usr/bin/zts-php, TEST_PHP_CGI_EXECUTABLE is set to /usr/bin/php-cgi (should not be set, or to /usr/bin/zts-php-cgi when present)


Until 8.0, TEST_PHP_CGI_EXECUTABLE was only set as .../sapi/cgi/php-cgi (sources tree) if exists.

Since 8.1 it is also set as .../php-cgi (installed tree). In this case, command prefix/suffix should be used.


Workaround is to set TEST_PHP_CGI_EXECUTABLE explicitly

Test script:
---------------
Discovered on datadog_trace extension
See https://github.com/DataDog/dd-trace-php/issues/1343


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-12 07:25 UTC] nikic@php.net
Any suggestion on what the right way to do this would be? The previous behavior is clearly also wrong (use source tree binary if install tree binary used). Should we try to transfer prefixes somehow? Skip guessing logic entirely if the basename of the binary is not "php"?
 [2021-10-12 07:45 UTC] remi@php.net
The following pull request has been associated:

Patch Name: improve CGI executable path detection for command prefix
On GitHub:  https://github.com/php/php-src/pull/7570
Patch:      https://github.com/php/php-src/pull/7570.patch
 [2021-10-12 11:35 UTC] git@php.net
Automatic comment on behalf of remicollet
Revision: https://github.com/php/php-src/commit/3fb1cf24c359dfca9e8f36bb1e092b93ad265f15
Log: Fix #81520 TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php
 [2021-10-12 11:35 UTC] git@php.net
-Status: Open +Status: Closed
 [2021-10-12 11:43 UTC] git@php.net
Automatic comment on behalf of remicollet
Revision: https://github.com/php/php-src/commit/ea00e6501c1083182fdfe7f898d9a2d49fce7c1c
Log: Fix #81520 TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC