- Install git
- Download and install PHP >= 7.2.0 ZTS with the required extensions
- PMMP-provided binaries
- Prebuilt binaries for each supported platform are distributed from here.
- If desired, our PHP build scripts can be used to build your own binary.
- See notes about prebuilt binaries for binary paths.
- This document will not cover the process of compiling PHP with the required extensions manually, but if you do you will need to:
- enable CLI (--enable-cli)
- enable ZTS (--enable-maintainer-zts)
- include all of the extensions required in
composer.json
(most are standard, the rest need to be installed manually using PECL or other tools)
- PMMP-provided binaries
If you use a prebuilt binary provided by us, replace php
with <path to wherever your bin folder is>/bin/php7/bin/php
Example: ~/downloads/bin/php7/bin/php
- In your CLI, run
cd
to move to the directory where you want to build PocketMine-MP. - Clone the PocketMine-MP git repository:
git clone https://github.com/pmmp/PocketMine-MP.git --recursive
- cd into the directory:
cd PocketMine-MP
- If you don't already have it, download composer:
curl https://getcomposer.org/installer | php
Now you're ready to build the phar file.
- Run
php composer.phar install
- (optional) Preprocess the source code:
php tests/preprocessor/PreProcessor.php --path src
- Run
php tests/plugins/PocketMine-DevTools/src/DevTools/ConsoleScript.php --make src,vendor,resources --relative ./ --entry src/pocketmine/PocketMine.php --out PocketMine-MP.phar
- Run the server to check it works:
php PocketMine-MP.phar
- In your CLI,
cd
into the git repository your previously cloned. - Run
git pull
- Run
git submodule update --init --recursive
- Run
php composer.phar install
(this is necessary to update dependencies)
If you want to build a different branch (other than master
):
- If building from scratch: add
--branch=<branch you want to clone>
to thegit clone
command. - If building an update: run
git checkout -f <branch you want to use>
before runninggit pull
.