mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-11 20:04:05 +00:00
Make nicer errors for PHP binary not being found
This commit is contained in:
parent
7665f4f443
commit
d535f02096
17
start.cmd
17
start.cmd
@ -2,11 +2,24 @@
|
||||
TITLE PocketMine-MP server software for Minecraft: Bedrock Edition
|
||||
cd /d %~dp0
|
||||
|
||||
set PHP_BINARY=
|
||||
|
||||
where /q php.exe
|
||||
if %ERRORLEVEL%==0 (
|
||||
set PHP_BINARY=php
|
||||
)
|
||||
|
||||
if exist bin\php\php.exe (
|
||||
rem always use the local PHP binary if it exists
|
||||
set PHPRC=""
|
||||
set PHP_BINARY=bin\php\php.exe
|
||||
) else (
|
||||
set PHP_BINARY=php
|
||||
)
|
||||
|
||||
if "%PHP_BINARY%"=="" (
|
||||
echo Couldn't find a PHP binary in system PATH or %~dp0\bin\php
|
||||
echo Please refer to the installation instructions at https://doc.pmmp.io/en/rtfd/installation.html
|
||||
pause
|
||||
exit 1
|
||||
)
|
||||
|
||||
if exist PocketMine-MP.phar (
|
||||
|
@ -11,8 +11,13 @@ if($php -ne ""){
|
||||
}elseif(Test-Path "bin\php\php.exe"){
|
||||
$env:PHPRC = ""
|
||||
$binary = "bin\php\php.exe"
|
||||
}else{
|
||||
}elseif((Get-Command php -ErrorAction SilentlyContinue)){
|
||||
$binary = "php"
|
||||
}else{
|
||||
echo "Couldn't find a PHP binary in system PATH or $pwd\bin\php"
|
||||
echo "Please refer to the installation instructions at https://doc.pmmp.io/en/rtfd/installation.html"
|
||||
pause
|
||||
exit 1
|
||||
}
|
||||
|
||||
if($file -eq ""){
|
||||
|
Loading…
x
Reference in New Issue
Block a user