PHPCraft is an open-source Minecraft: Java Edition server implementation, written in PHP.
That being said, PHPCraft is not intended to ever become a fully-functional, production-ready Minecraft server. It is simply a project that I work on for fun in my free time, because the idea of writing a Minecraft server implementation in PHP is just really amusing to me.
PHPCraft is a fork of Andrew Vy's HHVMCraft project.
※ Note: While HHVMCraft did (as the name would suggest) support HHVM, PHPCraft does not.
PHPCraft currently targets and supports Minecraft Beta b1.7.3 (Beta/pre-Netty Protocol 14), but you can connect to it with modern Minecraft versions using ViaProxy (recommended) or DirtMultiVersion — see below for screenshots!
I would have targeted and supported a modern Minecraft version if I were writing PHPCraft from scratch today, but since this is based off of an existing project that already had a large amount of work done for b1.7.3 already… supporting a modern version would have pretty much required a full rewrite and would be a lot of work for what is again, just a project I'm doing for fun in my free time.
(Maybe if I ever somehow just have too much free time some day, perhaps… ;P)
※ Regarding Bedrock Edition clients connecting using Geyser: Geyser may not work correctly with PHPCraft (all the blocks become invisible for some unknown reason). I'm not sure if this is still an issue with recent versions of Geyser, though.
A modern Minecraft 1.17.1 client connected to a PHPCraft server. A Minecraft Beta b1.7.3 client was also connected to the PHPCraft server at the same time, viewing the same world.
(There are no doors or beds because those blocks do not work correctly yet in PHPCraft.)
The same Minecraft 1.17.1 client connected to the same PHPCraft server, but at a later time of day.
More screenshots can be found in the screenshots folder that include more times of day, as well as screenshots of the Minecraft Beta b1.7.3 client that was also connected to the same PHPCraft server at the time.
- PHP 8.x (recommended, actively used in development) or PHP 7.4 (older versions also work, but are not recommended — see below for more information)
brew install php
on macOS (requires Homebrew to be installed)sudo apt install php
on Debian-based Linux distributions- PHP for Windows
- The "Non Thread Safe" version is sufficient for our purposes, as PHPCraft only uses PHP on the CLI, and not as part of a web server.
- Composer
brew install composer
on macOS (requires Homebrew to be installed)- Follow these instructions on Linux
- Use the Composer installer on Windows
git clone https://github.com/akemin-dayo/PHPCraft.git
cd PHPCraft
composer install
php start.php # ./start.php also works
You can configure various options in start.php
, including (but not limited to) both the server port (25565
by default) and the IP address to bind to (0.0.0.0
by default)!
Consider using PHP 8 instead. The only reason why PHPCraft supports PHP 7 because it just so happens to work. I actively develop and test against PHP 8.
That being said, if you really must use PHP 7 for some reason…
- PHP 7.4: Run
composer update -W
. - PHP 7.3 (end-of-life): Run
composer update -W
. - PHP 7.2 (end-of-life): Run
composer require --no-update --dev phpunit/phpunit ^8
and thencomposer update -W
. - PHP 7.1 and 7.0 (end-of-life): Run
composer require --no-update monolog/monolog ^1
,composer require --no-update --dev phpunit/phpunit ^6
, and then finallycomposer update -W
.
※ IMPORTANT: Please be aware that PHP 7 is no longer actively supported. PHP 7.4 is only receiving critical security updates (no bug fixes), and PHP 7.3〜7.0 have completely reached end-of-life and are no longer receiving any security updates whatsoever.
- Protocol specification for Minecraft Beta b1.7.3 (Beta/pre-Netty Protocol 14) on wiki.vg (oldid 510)
- This is the last page revision pertaining to Beta/pre-Netty Protocol 14, made on 2011/08/14.
Licensed under the MIT License.