Bug #81520 [PATCH]: TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php

[email protected] ("[email protected]")
Newsgroups php.bugs,php.qa
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=81520&edit=1

 ID:                 81520
 Patch added by:     [email protected]
 Reported by:        [email protected]
 Summary:            TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php
 Status:             Open
 Type:               Bug
 Package:            Testing related
 Operating System:   Linux
 PHP Version:        8.1.0RC3
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2021-10-12 07:25:51] [email protected]

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 06:34:06] [email protected]

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



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81520&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.