├── .gitignore ├── README.md └── .github └── workflows └── pm3.yml /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AndroidPHP 2 | 3 | select language 4 | - english 5 | - [日本語](https://github.com/DaisukeDaisuke/AndroidPHP_old/blob/master/README_JP.md) 6 | 7 | select version(coming soon) 8 | - Android 4-6 9 | - Android 7+ 10 | - [Raspberry Pi 3b](https://github.com/DaisukeDaisuke/AndroidPHP_old/blob/master/RaspberryPi.md) (experimental) 11 | ## Android 4-6(and more) 12 | This is a php binary for PocketMine-MP. 13 | For using it on Android, need a terminal emulator. 14 | ### 15 | ## note 16 | This php binary is for 64bit. 17 | Please note that 32bit will not work. 18 | **This method has been tested on Android6 and Raspberry Pi 3b only and may not work on newer Android versions.** 19 | 20 | This php binary can still connect to the Internet. 21 | Also, the Raspberry Pi can connect to the Internet as is. 22 | To connect to the Internet on Android, you need to prepare resolv.conf and cacert.pem, which can be found in the download link in the description below. 23 | To run the server on Android, you need to prepare PMMP by yourself. 24 | 25 | ## Required Applications 26 | In this section, we will use "Android Terminal Emulator" as a terminal emulator. 27 | 28 | https://play.google.com/store/apps/details?id=jackpal.androidterm 29 | 30 | ## Installing php 31 | ### Download php 32 | The PHP can be downloaded from the [This release page](https://github.com/DaisukeDaisuke/AndroidPHP/releases). 33 | 34 | ![img1](https://user-images.githubusercontent.com/17798680/73345192-f9324300-42c6-11ea-9036-c162bf03c5bd.png) 35 | 36 | ## Installing php 37 | Please execute the following command. 38 | To paste text from the clipboard, press and hold the screen in the "Android Terminal Emulator" application, and please select "Paste". 39 | ``` 40 | cp /storage/emulated/0/Download/php /data/data/jackpal.androidterm/app_HOME/php 41 | chmod 777 /data/data/jackpal.androidterm/app_HOME/php 42 | ``` 43 | 44 | ## Download various files to connect to the Internet 45 | Please Download the various files (resolv.conf, cacert.pem, php.ini) from the following download links. 46 | 47 | #### direct downloads 48 | - [cacert.pem](https://curl.haxx.se/ca/cacert.pem) 49 | - [resolv.conf](https://www.dropbox.com/s/xwta1aobds1557e/resolv.conf?dl=1) 50 | - [php.ini](https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php.ini) 51 | 52 | ## Placing the various files 53 | Please copy all the downloaded files `cacert.pem`, `resolv.conf`, and `php.ini` to the `/storage/emulated/0/PocketMine/config/` folder. 54 | 55 | ## Install PocketMine-MP 56 | Please download "PocketMine-MP.phar" from the following link and copy it to "/storage/emulated/0/PocketMine/". 57 | https://github.com/pmmp/PocketMine-MP/releases/latest/download/PocketMine-MP.phar 58 | 59 | ## launch PocketMine-MP 60 | Launch "Android Terminal Emulator" downloaded from Google Play, and execute the following command. 61 | ``` 62 | cd /storage/emulated/0/PocketMine/ 63 | env LESMI_RESOLV_CONF_DIR=/storage/emulated/0/PocketMine/config/resolv.conf SSL_CERT_FILE=/storage/emulated/0/PocketMine/config/cacert.pem /data/data/jackpal.androidterm/app_HOME/php -c /storage/emulated/0/PocketMine/config/php.ini /storage/emulated/0/PocketMine/PocketMine-MP.phar 64 | ``` 65 | The LESMI_RESOLV_CONF_DIR environment variable is created by the modified musl (gcc). 66 | 67 |
68 | 69 | #### Other information 70 |
71 | A url that links directly to the latest binary. 72 |
73 | 74 | ``` 75 | pm3 76 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php 77 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php-gd 78 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php-gd-no-modification 79 | pm3-zip 80 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php.zip 81 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/zip-php-gd.zip 82 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/zip-php-gd-no-modification.zip 83 | php.ini 84 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php-pm4.ini 85 | pm4 86 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php-pm4-gd 87 | pm4-zip 88 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php-pm4-gd.zip 89 | php.ini 90 | https://github.com/DaisukeDaisuke/AndroidPHP/releases/latest/download/php.ini 91 | ``` 92 |
93 | 94 | -------------------------------------------------------------------------------- /.github/workflows/pm3.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_dispatch: 3 | inputs: 4 | tagname: 5 | description: 'tagname' 6 | required: true 7 | default: '8.0.20' 8 | commithash: 9 | description: 'commit hash' 10 | required: true 11 | default: 'none' 12 | createRelease: 13 | description: 'If "yes", create the release.' 14 | required: true 15 | default: 'yes' 16 | 17 | name: Release Binaries pmmp 3 18 | 19 | jobs: 20 | build-php: 21 | name: Building cross compiler for android-aarch64 22 | runs-on: ubuntu-latest 23 | 24 | strategy: 25 | fail-fast: true 26 | matrix: 27 | include: 28 | - option: "-P 4" 29 | name: "" 30 | branch: "php/8.1" 31 | upload-php-ini: "no" 32 | musl-cross-make-repo: "DaisukeDaisuke/musl-cross-make" 33 | - option: "-g -P 4" 34 | name: "-gd" 35 | branch: "php/8.1" 36 | upload-php-ini: "no" 37 | musl-cross-make-repo: "DaisukeDaisuke/musl-cross-make" 38 | - option: "-g -P 4" 39 | name: "-gd-no-modification" 40 | branch: "php/8.1" 41 | upload-php-ini: "" 42 | musl-cross-make-repo: "ScerIO/musl-cross-make" 43 | - option: "-g -P 5" 44 | name: "-next-major-gd" 45 | branch: "php/8.1" 46 | upload-php-ini: "-next-major" 47 | musl-cross-make-repo: "DaisukeDaisuke/musl-cross-make" 48 | - option: "-g -P 5" 49 | name: "-experimental-gd" 50 | branch: "php/8.2" 51 | upload-php-ini: "-experimental-gd" 52 | musl-cross-make-repo: "DaisukeDaisuke/musl-cross-make" 53 | # Please note that if editing the matrix, the release workflow must also be edited. 54 | steps: 55 | - name: init directories 56 | run: mkdir -p aarch64-linux-musl 57 | - name: fetch aarch64-linux-musl from github release 58 | working-directory: aarch64-linux-musl 59 | run: wget -q -O "aarch64-linux-musl.tar.xz" "https://github.com/${{ matrix.musl-cross-make-repo }}/releases/latest/download/aarch64-linux-musl.tar.xz" 60 | 61 | - name: unzip aarch64-linux-musl and append path 62 | working-directory: aarch64-linux-musl 63 | run: | 64 | tar Jxfv aarch64-linux-musl.tar.xz > /dev/null 65 | echo "$(pwd)/bin" >> $GITHUB_PATH 66 | 67 | - uses: actions/checkout@v2 68 | with: 69 | repository: pmmp/php-build-scripts 70 | path: php-build-scripts 71 | ref: ${{ matrix.branch }} 72 | 73 | - name: Checkout php-build-scripts commit 74 | if: ${{ github.event.inputs.commithash != 'none' }} 75 | working-directory: php-build-scripts 76 | run: git checkout ${{ github.event.inputs.commithash }} 77 | 78 | - name: patch compile.sh 79 | working-directory: php-build-scripts 80 | run: sed -i=".backup" 's/LIBZIP_VERSION=".*"/LIBZIP_VERSION="1.9.2"/' ./compile.sh 81 | 82 | - name: install module 83 | run: | 84 | sudo apt update &> /dev/null 85 | sudo apt install -y re2c libtool libtool-bin zlib1g-dev libcurl4-openssl-dev libxml2-dev libyaml-dev libgmp-dev libzip-dev libssl-dev &> /dev/null 86 | 87 | - name: making aarch64 php 88 | working-directory: php-build-scripts 89 | run: ./compile.sh -t android-aarch64 -x -j2 ${{ matrix.option }} 90 | 91 | - name: copy php 92 | run: cp ./php-build-scripts/bin/php7/bin/php "php${{ matrix.name }}" 93 | 94 | - uses: actions/upload-artifact@v1 95 | with: 96 | name: "php${{ matrix.name }}" 97 | path: "./php${{ matrix.name }}" 98 | 99 | - name: copy php.ini 100 | if: ${{ matrix.upload-php-ini != 'no'}} 101 | run: cp ./php-build-scripts/bin/php7/bin/php.ini ./php${{ matrix.upload-php-ini }}.ini 102 | 103 | - uses: actions/upload-artifact@v1 104 | if: ${{ matrix.upload-php-ini != 'no'}} 105 | with: 106 | name: php${{ matrix.upload-php-ini }}.ini 107 | path: "./php${{ matrix.upload-php-ini }}.ini" 108 | commit-php: 109 | name: release 110 | needs: build-php 111 | runs-on: ubuntu-latest 112 | if: ${{ github.event.inputs.createRelease == 'yes'}} 113 | steps: 114 | - name: Download a Build Artifact(php) 115 | uses: actions/download-artifact@v2 116 | with: 117 | name: php 118 | 119 | - name: Download a Build Artifact(php-gd) 120 | uses: actions/download-artifact@v2 121 | with: 122 | name: php-gd 123 | 124 | - name: Download a Build Artifact(php-gd-no-modification) 125 | uses: actions/download-artifact@v2 126 | with: 127 | name: php-gd-no-modification 128 | 129 | - name: Download a Build Artifact(php-next-major-gd) 130 | uses: actions/download-artifact@v2 131 | with: 132 | name: php-next-major-gd 133 | 134 | - name: Download a Build Artifact(php-experimental-gd) 135 | uses: actions/download-artifact@v2 136 | with: 137 | name: php-experimental-gd 138 | 139 | - name: Download a Build Artifact(php.ini) 140 | uses: actions/download-artifact@v2 141 | with: 142 | name: php.ini 143 | - name: Download a Build Artifact(php-next-major.ini) 144 | uses: actions/download-artifact@v2 145 | with: 146 | name: php-next-major.ini 147 | - name: Download a Build Artifact(php-experimental-gd.ini) 148 | uses: actions/download-artifact@v2 149 | with: 150 | name: php-experimental-gd.ini 151 | 152 | 153 | - name: file compressions 154 | run: | 155 | zip -9 zip-php php 156 | zip -9 zip-php-gd php-gd 157 | zip -9 zip-php-gd-no-modification php-gd-no-modification 158 | zip -9 zip-php-next-major-gd php-next-major-gd 159 | zip -9 zip-php-experimental-gd php-experimental-gd 160 | 161 | - name: create checksums.sha256 162 | run: | 163 | sha256sum "php" "php-gd" "php-gd-no-modification" "php-next-major-gd" "php-experimental-gd" "zip-php.zip" "zip-php-gd.zip" "zip-php-gd-no-modification.zip" "zip-php-next-major-gd.zip" "zip-php-experimental-gd.zip" "php.ini" "php-next-major.ini" "php-experimental-gd.ini" > checksums.sha256 164 | cat checksums.sha256 165 | 166 | - uses: actions/upload-artifact@v1 167 | with: 168 | name: "checksums.sha256" 169 | path: "./checksums.sha256" 170 | 171 | - name: Create Release 172 | uses: softprops/action-gh-release@v1 173 | with: 174 | tag_name: ${{ github.event.inputs.tagname }} 175 | name: Release ${{ github.event.inputs.tagname }} 176 | files: | 177 | php 178 | php-gd 179 | php-gd-no-modification 180 | php-next-major-gd 181 | php-experimental-gd 182 | zip-php.zip 183 | zip-php-gd.zip 184 | zip-php-gd-no-modification.zip 185 | zip-php-next-major-gd.zip 186 | zip-php-experimental-gd.zip 187 | php.ini 188 | php-next-major.ini 189 | php-experimental-gd.ini 190 | checksums.sha256 191 | body: "The php version for this release is ${{ github.event.inputs.tagname }}. 192 | 193 | The download is available from the Assets dropdown. 194 | 195 | #### Notes 196 | 197 | This binary does not support jit. 198 | 199 | This binary is for ARMv8 (aarch64, 64bit). 200 | 201 | It does not work on arm (32bit). 202 | 203 | All binaries are not compatible with pmmp3 and are for pmmp4. 204 | 205 | the php or php-gd binaries are recommended. 206 | 207 | The php version of php-next-major-gd is 8.1.. 208 | The php version of php-experimental-gd is 8.2.. 209 | " 210 | --------------------------------------------------------------------------------