Skip to content

Commit ccfabb0

Browse files
committed
Make sure php inherits the correct overridden PATH, in case of subprocesses
1 parent 17a9308 commit ccfabb0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

overrides/path/php.bat

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@ set WRAPPER_FOLDER=%THIS_PATH:~0,-1%
1010
REM Remove that folder from PATH
1111
call set PATH=%%PATH:%WRAPPER_FOLDER%;=%%
1212

13+
REM Get the real php path, store it in %REAL_PHP%
14+
FOR /F "tokens=*" %%g IN ('where php') do (SET REAL_PHP=%%g)
15+
16+
REM Reset PATH, so its visible to php & subprocesses
17+
set PATH=%ORIGINALPATH%
18+
1319
REM Start PHP for real, with extra args to override certain configs
14-
php -d "openssl.cafile=%SSL_CERT_FILE%" -d "curl.cainfo=%SSL_CERT_FILE%" -d "auto_prepend_file=%WRAPPER_FOLDER%\prepend.php" %*
20+
"%REAL_PHP%" -d "openssl.cafile=%SSL_CERT_FILE%" -d "curl.cainfo=%SSL_CERT_FILE%" -d "auto_prepend_file=%WRAPPER_FOLDER%\prepend.php" %*

0 commit comments

Comments
 (0)