GithubHelp home page GithubHelp logo

php-binaries's Introduction

Custom PHP build scripts for PocketMine-MP

Build status

Looking for prebuilt binaries? Head over to releases

compile.sh

Bash script used to compile PHP on MacOS and Linux platforms. Make sure you have make autoconf automake libtool m4 wget getconf gzip bzip2 bison g++ git cmake pkg-config re2c ca-certificates.

Recommendations

  • If you're going to use the compiled binary only on the machine you're build it on, remove the -t option for best performance - this will allow the script to optimize for the current machine rather than a generic one.
  • ext-gd2 is NOT included unless the -g flag is provided, as PocketMine-MP doesn't need it. However, if your plugins need it, don't forget to enable it using -g.
  • The -c and -l options can be used to specify cache folders to speed up recompiling if you're recompiling many times (e.g. to improve the script).

Common pitfalls

  • Avoid using the script in directory trees containing spaces. Some libraries don't like trying to be built in directory trees containing spaces, e.g. /home/user/my folder/pocketmine-mp/ might experience problems.
  • Avoid directory trees containing special (non-English) symbols. For example, Développement might cause issues.

Additional notes

Mac OSX (native compile)

  • Most dependencies can be installed using Homebrew
  • You will additionally need glibtool (GNU libtool, xcode libtool won't work)

Android 64-bit (cross-compile)

  • Only aarch64 targets are supported for Android cross-compile.
  • The aarch64-linux-musl toolchain is required. You can compile and install it using https://github.com/pmmp/musl-cross-make (PMMP fork includes musl-libc patches for DNS resolver config path and increasing stack size limit for LevelDB)
Script flags Description
-c Uses the folder specified for caching downloaded tarballs, zipballs etc.
-d Compiles with debugging symbols and disables optimizations (slow, but useful for debugging segfaults)
-D Compiles with separated debugging symbols, but leaves optimizations enabled (used for distributed binaries)
-g Will compile GD2
-j Set make threads to #
-l Uses the folder specified for caching compilation artifacts (useful for rapid rebuild and testing)
-n Don't remove sources after completing compilation
-s Will compile everything statically
-t Set target
-v Enable Valgrind support in PHP
-x Specifies we are doing cross-compile
-P Compiles extensions for the major PocketMine-MP version specified (can be 4 or 5)

Example:

Target Arguments
linux64 -t linux64 -j4 -P5
linux64, PM4 -t linux64 -j4 -P4
mac64 -t mac-x86-64 -j4 -P5
android-aarch64 -t android-aarch64 -x -j4 -P5

windows-compile-vs.bat

Batch script utilizing Visual Studio on Windows to compile PHP binaries from sources. Ensure you have Visual Studio 2019, git, 7z and wget installed in your PATH.

This script doesn't accept parameters, but the following environment variables are influential:

Variable Description
PHP_DEBUG_BUILD Disables optimisations and builds PHP with detailed debugging information (useful for debugging segfaults)
SOURCES_PATH Where to put the downloaded sources for compilation
VS_EDITION Edition of Visual Studio installed, set to Community by default
PM_VERSION_MAJOR Major version of PocketMine-MP to build extensions for (defaults to 4, can be 4 or 5)

php-binaries's People

Contributors

alex2534alex avatar coonce avatar crischutu07 avatar daisukedaisuke avatar danmudd avatar dependabot[bot] avatar dktapps avatar encritary avatar evelire avatar frago9876543210 avatar fuyutsuki avatar humerus avatar intyre avatar jaxkdev avatar kmatuszak avatar legoboy0215 avatar michaelm04 avatar mrtechno avatar msjyoo avatar narapons avatar padreon avatar robske110 avatar shoghicp avatar sof3 avatar tarik02 avatar witalijx avatar xerenahmed avatar zkoz210 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-binaries's Issues

Artifact caching

Waiting for compile.sh to rebuild everything after every bug fix is very tiresome. Artifact caching would help fix this problem by speeding up debugging.

SSL certificate bundles missing

This is problematic for functions which depend on features provided by openssl, such as https:// support in file_get_contents().

installer.sh fails on MacOS Sierra with date error

Running ./installer.sh results in this error.

mini:PocketMine-MP zim$ ./installer.sh
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
[!] Couldn't get the latest PocketMine-MP version

php -v
PHP 7.1.0 (cli) (built: Dec 2 2016 09:19:56) ( NTS )

How to install?

How to install it on Windows?... It is bash. Yes, it can be run on Windows 10 N 64-bit but I have 32-bit. So...???

outdate options for gcc (-V and -qversion

https://superuser.com/questions/846768/gcc-unrecognized-command-line-options-v-and-qversion-with-autoconf

$ gcc -qversion

gcc: error: unrecognized command line option ‘-qversion’
gcc: fatal error: no input files
compilation terminated.

$ gcc -V

gcc: error: unrecognized command line option ‘-V’
gcc: fatal error: no input files
compilation terminated.

Compile-time output

$ ./compile.sh
...
[PHP pthreads] downloading 3.1.6... done!
[PHP Weakref] downloading 0.3.2... done!
[PHP YAML] downloading 2.0.0RC7... done!
[PHP] checking...

in file ./install_data/php/config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --disable-inline-optimization --prefix=/home/pocketmine/pocketmine/bin/php7 --exec-prefix=/home/pocketmine/pocketmine/bin/php7 --with-curl=/home/pocketmine/pocketmine/bin/php7 --with-zlib=/home/pocketmine/pocketmine/bin/php7 --with-zlib-dir=/home/pocketmine/pocketmine/bin/php7 --with-mcrypt=/home/pocketmine/pocketmine/bin/php7 --with-gmp=/home/pocketmine/pocketmine/bin/php7 --with-png-dir=/home/pocketmine/pocketmine/bin/php7 --with-yaml=/home/pocketmine/pocketmine/bin/php7 --with-gd --without-ncurses --without-readline --disable-debug --enable-mbstring --enable-calendar --enable-pthreads --disable-fileinfo --disable-libxml --disable-xml --disable-dom --disable-simplexml --disable-xmlreader --disable-xmlwriter --disable-cgi --disable-session --disable-pdo --without-pear --without-iconv --without-pdo-sqlite --with-pic --enable-phar --enable-ctype --enable-sockets --enable-shared=no --enable-static=yes --enable-shmop --enable-maintainer-zts --disable-short-tags --enable-pcntl --enable-embedded-mysqli --enable-mysqlnd --with-mysqli=mysqlnd --enable-bcmath --enable-cli --enable-zip --enable-ftp --with-zend-vm=GOTO --enable-opcache=yes --enable-weakref

## --------- ##
## Platform. ##
## --------- ##

hostname = orangepipc
uname -m = armv7l
uname -r = 3.4.113-sun8i
uname -s = Linux
uname -v = #10 SMP PREEMPT Thu Feb 23 19:55:00 CET 2017

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games


## ----------- ##
## Core tests. ##
## ----------- ##

configure:3245: checking for grep that handles long lines and -e
configure:3303: result: /bin/grep
configure:3308: checking for egrep
configure:3370: result: /bin/grep -E
configure:3375: checking for a sed that does not truncate output
configure:3429: result: /bin/sed
configure:3534: checking build system type
configure:3548: result: armv7l-unknown-linux-gnueabihf
configure:3568: checking host system type
configure:3581: result: armv7l-unknown-linux-gnueabihf
configure:3601: checking target system type
configure:3614: result: armv7l-unknown-linux-gnueabihf
configure:3847: checking for C compiler version
configure:3856: gcc --version >&5
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3867: $? = 0
configure:3856: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10) 
configure:3867: $? = 0
configure:3856: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3867: $? = 4
configure:3856: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
...

Installer don't work

Hi,
I want to install PoketMine on my raspberry pi 3 B but the scrip don't do anythig.

pi@raspberrypi3:~/PocketMine $ wget https://raw.githubusercontent.com/pmmp/php-build-scripts/master/installer.sh
--2017-02-16 13:38:39-- https://raw.githubusercontent.com/pmmp/php-build-scripts/master/installer.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.60.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.60.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17393 (17K) [text/plain]
Saving to: ‘installer.sh’

installer.sh 100%[=====================>] 16.99K --.-KB/s in 0.02s

2017-02-16 13:38:40 (890 KB/s) - ‘installer.sh’ saved [17393/17393]

pi@raspberrypi3:~/PocketMine $ bash installer.sh
[!] Couldn't download version automatically from Jenkins server

Compiling with leveldb support

So I'm trying to compile the leveldb extension on my raspberry pi pocketmine server so I can use mcpe worlds. It's using php 7. Whenever I try to do this using the compile.sh with the argument -l and the target as rpi (raspberry pi) it does it but when I run my server it says "Couldn't find a working PHP 7 binary, please use the installer." I'm using windows 10.

Apparently this doesn't work with php 7 so how do I downgrade my php binary so that I can do this?

Stops compiling for no reason?

[PocketMine] PHP compiler for Linux, MacOS and Android
[INFO] Checking dependecies
[INFO] Compiling for current machine using 64-bit
[PHP] downloading 7.0.13... done!
[zlib] downloading 1.2.8... checking... compiling... installing... cleaning... done!
[mcrypt] downloading 2.5.8... checking... compiling... installing... cleaning... done!
[GMP] downloading 6.1.0... checking... compiling... installing... cleaning... done!
[mbed TLS] downloading 2.2.1... checking... compiling... installing... cleaning... done!
[cURL] downloading curl-7_47_1... checking... compiling... installing... cleaning... done!
[YAML] downloading 0.1.7... checking... compiling... installing... cleaning... done!
[libpng] downloading 1.6.25...
xel@server1:~$

I have installed all the dependencies, but it stops. (Same occurred when I tried 7.0.14)

Running Ubuntu 15.10 64bit

not compiled on armbian

-m32 is an x86 option. It is not supported (or needed) on ARM, where different toolchains are used for 32-bit and 64-bit code.

The 64-bit ARM (AArch64) toolchain is called aarch64-linux-gnu.

Compiling with simplexml extension

The MineMarketPE plugin use $xml = simplexml_load_file($url); method, and not work pmmp php files.
How to compile PHP with simplexml extension?

29.05 00:00:12 [Server] Server thread/CRITICAL Could not execute task MineMarket\ScheduleTask: Call to undefined function MineMarket\simplexml_load_file()

Detected spam

SO reduced this issue because it is spam and Fe2+ oxidized this issue to base64 because it is a 24-hour no-life disrespectful watcher of issues.
Original content:

VGl0bGU6IERldGVjdGVkIHNwYW0KQm9keTogT24gbWFjT1MgQ2F0YWxpbmEgQmV0YSAoMTlBNDg3
bCksIGBwaHBgIGZ1Y2tzIGl0c2VsZiBldmVyeSB0aW1lIEkgcnVuIC4vc3RhcnQuc2guIFNpbmNl
IHRoZSBQb2NrZXRNaW5lIGJ1aWxkIG9mIGBwaHBgIGlzbid0IG5vdGFyaXplZCBHYXRla2VlcGVy
IHRocm93cyBhIGxvYWQgb2YgZXJyb3JzIGFib3V0IGBwaHBgIGFuZCBidW5jaCBvZiBpdCdzIGV4
dGVuc2lvbnMgbm90IGJlaW5nIGZyb20gdGhlIEFwcCBTdG9yZSBvciBhbiBpZGVudGlmaWVkIGRl
dmVsb3Blci4NCg0KPGltZyB3aWR0aD0iNzgwIiBhbHQ9IlNjcmVlbiBTaG90IDIwMTktMDYtMjcg
YXQgNiA0NyAwNSBwbSIgc3JjPSJodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50
LmNvbS80MDMwNzMwNS82MDMwMzkzOC01OTI2Y2M4MC05OTI3LTExZTktOTYwYi00ZDhhYjdhYzVh
YWMucG5nIj4NCjxpbWcgd2lkdGg9IjUzMiIgYWx0PSJTY3JlZW4gU2hvdCAyMDE5LTA2LTI3IGF0
IDYgNDcgNDcgcG0iIHNyYz0iaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5j
b20vNDAzMDczMDUvNjAzMDM5MzktNTkyNmNjODAtOTkyNy0xMWU5LTk0ZjctN2EyMmZlMzZhYmQy
LnBuZyI+DQo8aW1nIHdpZHRoPSI1MzIiIGFsdD0iU2NyZWVuIFNob3QgMjAxOS0wNi0yNyBhdCA2
IDQ4IDIxIHBtIiBzcmM9Imh0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29t
LzQwMzA3MzA1LzYwMzAzO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zcyB1c2luZyBMaWJyYXJ5IFZhbGlkYXRpb246IExpYnJhcnkgbG9hZCBkaXNhbGxvd2VkIGJ5
IFN5c3RlbSBQb2xpY3kNCgkvVXNlcnMvbmF0aGZyZWRlci9Db2RpbmcvUG9ja2V0TWluZS1NUC9i
aW4vcGhwNy9iaW4vLi4vbGliL2xpYmxldmVsZGIuZHlsaWIuMTogc3RhdCgpIGZhaWxlZCB3aXRo
IGVycm5vPTENCnpzaDogYWJvcnQgICAgICAuL3N0YXJ0LnNoDQpgYGANCg==

Can't add to the PHP

After the message "[PHP] check... compile..." the process stops.

At the end of the log there is an error:

g++: error: unrecognized command line option '-std=c++14'
make: *** [ext/ext-chunkutils2/chunkutils2.lo] Error 1

help please

Remove composer from PHP builds

The average end user shouldn't be using Composer, so we shouldn't be shipping it. Only developers will need it, and they should know how to get it.

Allow specifying prefix

Instead of forcing bin/php7, make it an option, especially for people who want to install it in /usr, /usr/local, $HOME/.local, etc.

Support for PDO-driver

We're currently experiencing an issue with MySQL.

As we're planning to create a own plugin that needs database access, PDO is definitely a must.
Without PDO, libraries like Medoo won't work as PDO is required for that.

I know that PMMP is using a binary installation for PHP7.2, is there any possibility to implement or change something so we can get a binary compiled including PDO?

compile failure for libjpeg(aarch64-linux-musl)

I built php by VirtualBox on windows(CentOS 7.5).

Compile Options

./compile.sh -t android-aarch64 -x -s -j4 -f -g

Console output

[daisukedaisuke@localhost repo-7.2.7]$ ./compile.sh -t android-aarch64 -x -s -j4 -f -g
[PocketMine] PHP compiler for Linux, MacOS and Android
[INFO] Checking dependencies
[opt] Set target to android-aarch64
[opt] Doing cross-compile
[opt] Will compile everything statically
[opt] Set make threads to 4
[opt] Enabling abusive optimizations...
[opt] Will enable GD2
[INFO] Cross-compiling for Android ARMv8 (aarch64)
[PHP] downloading 7.2.7... done!
[zlib] downloading 1.2.11... checking... compiling... installing... done!
[GMP] downloading 6.1.2... checking... compiling... installing... done!
[mbed TLS] downloading 2.11.0... checking... compiling... installing... done!
[OpenSSL] downloading 1.1.0h... checking... compiling... installing... done!
[cURL] downloading curl-7_60_0... checking... compiling... installing... done!
[YAML] downloading 0.1.7... checking... compiling... installing... done!
[libpng] downloading 1.6.34... checking... compiling... installing... done!
[libjpeg] downloading 8... checking...[daisukedaisuke@localhost repo-7.2.7]$ 

install.log

configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `aarch64-linux-musl': machine `aarch64-linux' not recognized
configure: error: /bin/sh ./config.sub aarch64-linux-musl failed

All install.log
install.log

installer.sh still points to pocketmine-mp

Hi,

If using the installer script here, you still get the code from the PocketMine-MP bintray.

I can patch the code in installer.sh to get the latest "phar" from jenkins. Are you interested in that type of code?

Compiling binaries failing on macOS

Since some time (I don't know when I compiled binaries the last time, should be weeks or months ago), building the PHP binaries on is failing for me on macOS.

Console output:

Last login: Mon Apr 23 17:37:38 on ttys000
Jarnes-iMac:~ jarne$ cd Downloads
Jarnes-iMac:Downloads jarne$ git clone https://github.com/pmmp/php-build-scripts.git
Cloning into 'php-build-scripts'...
remote: Counting objects: 1360, done.
remote: Total 1360 (delta 0), reused 0 (delta 0), pack-reused 1360
Receiving objects: 100% (1360/1360), 313.60 KiB | 539.00 KiB/s, done.
Resolving deltas: 100% (865/865), done.
Jarnes-iMac:Downloads jarne$ cd php*
Jarnes-iMac:php-build-scripts jarne$ ./compile.sh -t mac64 -j 8 -c -f
[PocketMine] PHP compiler for Linux, MacOS and Android
[INFO] Checking dependencies
[opt] Set target to mac64
[opt] Set make threads to 8
[opt] Will force compile cURL
[opt] Enabling abusive optimizations...
[INFO] Compiling for Intel MacOS x86_64
[PHP] downloading 7.2.4... done!
[zlib] downloading 1.2.11... checking... compiling... installing... done!
[GMP] downloading 6.1.2... checking... compiling... installing... done!
[mbed TLS] downloading 2.6.0... checking... compiling... installing... done!
[OpenSSL] downloading 1.1.0g... checking... compiling... installing... done!
[cURL] downloading curl-7_57_0... checking... compiling...Jarnes-iMac:php-build-scripts jarne$ 

And the install.log:
https://gist.github.com/jarne/b95de46a87ed1bc1153bdf0e0538eb6e

I download the bin file at the Jenkins.io but it errors

root@ps88:~/pm# sudo ./start.sh
./start.sh: line 54: /root/pm/bin/php7/bin/php: cannot execute binary file: Exec format error
./start.sh: line 54: /root/pm/bin/php7/bin/php: Success
The Bin file's version is php7.2 and OS is Linux(Ubuntu).

(Sorry about my bad English..)

Compile failure in Centos6

I've tried very many times. The program crashes when PHP checking is executed. I tried to replace the PHP version of php7.2.5, but still can not solve the problem.
[PHP] Downloading additional extensions...
pthreads: downloading d32079f
2dd7deb403... done!
yaml: downloading 2.0.2... done!
igbinary: downloading 4b61818d361cf2c51472956b4a6e2
be363d681a... done!
ds: downloading f3989cbfca634256e29f155d6fff77e0e50
5ab8... done!
[PHP] checking...[root@MyServer613 bin]#

Android php DNS Error

I don't usually use English.
So my English is some strange point.

I have a one problem!
It's very important to use pmmp for Android.
I can't connect Internet because php file don't want to resolve dns.
This php file compile by pmmp repository.
Who can teach me how to resolve it?
Please fix this issue.

I built php by bash on windows(ubuntu).

var_dump(file_get_contents('http://www.example.com/'));

Warning: file_get_contents(): php_network_getaddresses: gethostbyname failed. errno=2 in Command line code on line 1

Warning: file_get_contents(http://www.example.com/): failed to open stream: php_network_getaddresses: gethostbyname failed. errno=2 in Command line code on line 1
bool(false)

php version

PHP 7.2.2 (cli) (built: Feb 20 2018 19:26:51) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

app
https://play.google.com/store/apps/details?id=jackpal.androidterm

plz check the autoconf and cmake version for centos9

in centos9, there's no prebuilt php binary.
so the install script comiple a php from source.
but the autoconf and cmake version is too old but the version checker in install.log said the version is OK.

plz give a hint that the version is too old and let the user update it.
thx.

Installtion Script: macOS PHP build issue on macOS 10.13.6

Issue description

There is a issue in the installation script, LINE 302 gives following PHP Warning which let the prebuild php7 package fail.

LINE 302: if [ "$(./bin/php7/bin/php -r 'echo 1;' 2>/dev/null)" == "1" ]; then

MBP:pocketMine XXX$ ./bin/php7/bin/php -r 'echo 1;'
PHP Warning:  PHP Startup: Unable to load dynamic library 'curl.so' (tried: /Users/user/php-build-scripts/bin/php7/lib/php/extensions/no-debug-zts-20170718/curl.so (dlopen(/Users/user/php-build-scripts/bin/php7/lib/php/extensions/no-debug-zts-20170718/curl.so, 9): image not found), /Users/user/php-build-scripts/bin/php7/lib/php/extensions/no-debug-zts-20170718/curl.so.so (dlopen(/Users/user/php-build-scripts/bin/php7/lib/php/extensions/no-debug-zts-20170718/curl.so.so, 9): image not found)) in Unknown on line 0

The problem here is the path to the extensions library for curl. It's set after the installation script tried to to run php -.-

Current:

		echo -n " checking..."

		if [ "$(./bin/php7/bin/php -r 'echo 1;' 2>/dev/null)" == "1" ]; then
			echo -n " updating php.ini..."

			sed -i'.bak' "s/date.timezone=.*/date.timezone=$(date +%Z)/" bin/php7/bin/php.ini

			EXTENSION_DIR=$(find "$(pwd)/bin" -name *debug-zts*) #make sure this only captures from `bin` in case the user renamed their old binary folder
			#Modify extension_dir directive if it exists, otherwise add it
			grep -q '^extension_dir' bin/php7/bin/php.ini && sed -i'bak' "s{^extension_dir=.*{extension_dir=\"$EXTENSION_DIR\"{" bin/php7/bin/php.ini || echo "extension_dir=\"$EXTENSION_DIR\"" >> bin/php7/bin/php.ini

			echo " done"
			alldone=yes
		else
			echo " downloaded PHP build doesn't work on this platform!"
		fi

Fix:

		echo -n " updating php.ini..."

		sed -i'.bak' "s/date.timezone=.*/date.timezone=$(date +%Z)/" bin/php7/bin/php.ini

		EXTENSION_DIR=$(find "$(pwd)/bin" -name *debug-zts*) #make sure this only captures from `bin` in case the user renamed their old binary folder
		#Modify extension_dir directive if it exists, otherwise add it
		grep -q '^extension_dir' bin/php7/bin/php.ini && sed -i'bak' "s{^extension_dir=.*{extension_dir=\"$EXTENSION_DIR\"{" bin/php7/bin/php.ini || echo "extension_dir=\"$EXTENSION_DIR\"" >> bin/php7/bin/php.ini
		
		echo -n " checking..."

		if [ "$(./bin/php7/bin/php -r 'echo 1;' 2>/dev/null)" == "1" ]; then
			echo " done"
			alldone=yes
		else
			echo " downloaded PHP build doesn't work on this platform!"
		fi

ONLY tested on macOS. It's logical to first setup the php.ini before running a test to find out if php is working.

Detected spam

SO reduced this issue because it is spam and Fe2+ oxidized this issue to base64 because it is a 24-hour no-life disrespectful watcher of issues.
Original content:

VGl0bGU6IERldGVjdGVkIHNwYW0KQm9keTogT24gbWFjT1MgQ2F0YWxpbmEgQmV0YSAoMTlBNDg3
bCksIGBwaHBgIGZ1Y2tzIGl0c2VsZiBldmVyeSB0aW1lIEkgcnVuIGAuL3N0YXJ0LnNoYC4gU2lu
Y2UgdGhlIFBvY2tldE1pbmUgYnVpbGQgb2YgYHBocGAgaXNuJ3Qgbm90YXJpemVkIEdhdGVrZWVw
ZXIgdGhyb3dzIGEgbG9hZCBvZiBlcnJvcnMgYWJvdXQgYHBocGAgYW5kIGJ1bmNoIG9mIGl0J3Mg
ZXh0ZW5zaW9ucyBub3QgYmVpbmcgZnJvbSB0aGUgQXBwIFN0b3JlIG9yIGFuIGlkZW50aWZpZWQg
ZGV2ZWxvcGVyLg0KDQo8aW1nIHdpZHRoPSI3ODAiIGFsdD0iU2NyZWVuIFNob3QgMjAxOS0wNi0y
NyBhdCA2IDQ3IDA1IHBtIiBzcmM9Imh0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRl
bnQuY29tLzQwMzA3MzA1LzYwMzAzMzI1LWEzMGViMzAwLTk5MjUtMTFlOS05OWFlLTE4YjFhYjMx
ODI2Yi5wbmciPg0KPGltZyB3aWR0aD0iNTMyIiBhbHQ9IlNjcmVlbiBTaG90IDIwMTktMDYtMjcg
YXQgNiA0NyA0NyBwbSIgc3JjPSJodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50
LmNvbS80MDMwNzMwNS82MDMwM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pbiBwcm9jZXNzIHVzaW5nIExpYnJhcnkgVmFsaWRhdGlvbjogTGlicmFyeSBsb2FkIGRpc2Fs
bG93ZWQgYnkgU3lzdGVtIFBvbGljeQ0KCS9Vc2Vycy9uYXRoZnJlZGVyL0NvZGluZy9Qb2NrZXRN
aW5lLU1QL2Jpbi9waHA3L2Jpbi8uLi9saWIvbGlibGV2ZWxkYi5keWxpYi4xOiBzdGF0KCkgZmFp
bGVkIHdpdGggZXJybm89MQ0KenNoOiBhYm9ydCAgICAgIC4vc3RhcnQuc2gNCmBgYA==

Add XML extensions

Various tools need the XML extension set, which are usually expected to be provided OOB, but which we disable (--disable-all). Among these tools are PHPUnit, PHPStan, phpDocumentor and more.

php 7.1

When you update compile.sh? 7.1.5 already realised, it works 25% more faster.

Adding to php bin

How can I add it to my php bin? There is not setting in compile.sh

PHP 7.2 update issue with Autoconf 2.63

First it says v2.63 is fine, then it errors because it wants 2.64 or later:

Building PHP...
[PocketMine] PHP compiler for Linux, MacOS and Android
[INFO] Checking dependencies
[opt] Set target to linux64
[opt] Will compile with LevelDB support
[opt] Set make threads to 2
[opt] Will force compile cURL
[opt] Will compile with PocketMine-ChunkUtils C extension for Anvil
[opt] Enabling abusive optimizations...
[INFO] Compiling for Linux x86_64
[PHP] downloading 7.2.0RC1... done!
[zlib] downloading 1.2.11... checking... compiling... installing... done!
[GMP] downloading 6.1.2... checking... compiling... installing... done!
[mbed TLS] downloading 2.4.2... checking... compiling... installing... done!
[OpenSSL] downloading 1.1.0f... checking... compiling... installing... done!
[cURL] downloading curl-7_54_0... checking... compiling... installing... done!
[YAML] downloading 0.1.7... checking... compiling... installing... done!
[LevelDB] downloading f4022ac7c5a022f7a08a1b6dc98c06ef3eed352a... checking... compiling... installing... done!
[PHP pthreads] downloading 536a7b29ddd57a25209b5fb79b5abcf0ecd85f79... done!
[PHP Weakref] downloading 0.3.3... done!
[PHP YAML] downloading 2.0.2... done!
[PHP LevelDB] downloading 5cfe735dac5ceafc6848c96177509450febc12d0... done!
[PocketMine-ChunkUtils] Downloading master... done!
[PHP] enabling optimizations... checking...

ERROR!

The log file shows this at the end:

ln -fs libleveldb.so.1.18 out-shared/libleveldb.so
ln -fs libleveldb.so.1.18 out-shared/libleveldb.so.1
Forcing buildconf
Removing configure caches
buildconf: checking installation...
buildconf: autoconf version 2.63 (ok)
rebuilding aclocal.m4
rebuilding configure
configure.ac:278: error: Autoconf version 2.64 or higher is required
build/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
autom4te: /usr/bin/m4 failed with exit status: 63
rebuilding main/php_config.h.in
configure.ac:278: error: Autoconf version 2.64 or higher is required
build/ax_check_compile_flag.m4:60: AX_CHECK_COMPILE_FLAG is expanded from...
autom4te: /usr/bin/m4 failed with exit status: 63
autoheader: '/usr/bin/autom4te' failed with exit status: 63
./compile.sh: line 789: ./configure: No such file or directory

Failed to install php

I have install php 7.2.11 on my Linux Debian 8 vserver
root@robuki:~/server# php -v PHP 7.2.11-2+0~20181015120510.9+jessie~1.gbp8105e0 (cli) (built: Oct 16 2018 03:39:58) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.11-2+0~20181015120510.9+jessie~1.gbp8105e0, Copyright (c) 1999-2018, by Zend Technologies
I use the wget command to download pmmp the install failed
https://ibb.co/hmXa3L
https://ibb.co/hmkHHf
Then I use the php7.2 bin files from pmmp the start.sh from pmmp and the phar
Then this:
root@robuki:~/server# ./start.sh ./bin/php7/bin/php: error while loading shared libraries: libmvec.so.1: cannot open shared object file: No such file or directory
In your forum I found a help to your compile
https://forums.pmmp.io/threads/help-with-libmvec-please.5868/
Now I have this problem root@robuki:~/server# ./compile.sh [PocketMine] PHP compiler for Linux, MacOS and Android [INFO] Checking dependencies [INFO] Compiling for current machine using 64-bit [PHP] downloading 7.2.11... done! [zlib] downloading 1.2.11... checking... compiling... installing... done! [GMP] downloading 6.1.2... checking... compiling... installing... done! [OpenSSL] downloading 1.1.0h... checking... compiling... installing... done! [cURL] downloading curl-7_61_0... checking... compiling... installing... done! [YAML] downloading 0.2.1... checking... compiling... installing... done! [PHP] Downloading additional extensions... pthreads: downloading a3057347da7fde81c9ae82ac3669b9c08828c482... done! yaml: downloading 2.0.2... done! igbinary: downloading 2.0.7... done! ds: downloading 35a46a0fba1a0fe2bd4c61f6ea9891d8c4b5e94a...mv: cannot stat 'extension-35a46a0fba1a0fe2bd4c61f6ea9891d8c4b5e94a': No such file or directory
Can you help me
Please 😢

compile.sh fails on macOS Sierra if -d (xdebug) flag is used

To reproduce:

  1. First fix the following as noted in pull request commit c4f111d

-LIBPNG_VERSION="1.6.25"
+LIBPNG_VERSION="1.6.28"

  1. Now the script will run successfully UNLESS you use -d

Last few lines of install.log before it stops:

checking whether to enable tokenizer support... yes
checking whether to enable WDDX support... no
checking libexpat dir for WDDX... no
checking enable Weakref suppport... yes
checking whether to enable Xdebug support... yes, shared
checking Check for supported PHP versions... ./configure: line 86365: --version: command not found
configure: error: not supported. Need a PHP version >= 5.5.0 and < 7.2.0 (found )

Compiling for android-aarch64

./compile.sh -g -c -x -j 4 -t android-aarch64
[PocketMine] PHP compiler for Linux, MacOS and Android
[INFO] Checking dependencies
[opt] Will enable GD2
[opt] Will force compile cURL
[opt] Doing cross-compile
[opt] Set make threads to 4
[opt] Set target to android-aarch64
[INFO] Cross-compiling for Android ARMv8 (aarch64)
[ERROR] Please install "aarch64-linux-musl-gcc"

Can someone give me an hint on how to install aarch64-linux-musl-gcc ?
I tried googling and after a lot of researches all i found is this: https://github.com/GregorR/musl-cross but i have no idea on how to use it, i don't even know if it's the correct one.

any help is appreciated, thanks 😄

SourceForge is very slow | can't compile binaries

When I compile binaries - I'll take error:
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now

It's called when sh try download libpng. I tried to go to SourseForge - the site is loaded very slowly.
Are there ways to compile the binaries and still leave GD2?

_2018-02-25_16-38-21

compile failure for libzip(aarch64-linux-musl)

I built php by VirtualBox on windows(CentOS 7.5).

Console output

[daisukedaisuke@localhost php-build-scripts]$ ./compile.sh -t android-aarch64 -x -s -j4 -f
[PocketMine] PHP compiler for Linux, MacOS and Android
[INFO] Checking dependencies
[opt] Set target to android-aarch64
[opt] Doing cross-compile
[opt] Will compile everything statically
[opt] Set make threads to 4
[opt] Enabling abusive optimizations...
[INFO] Cross-compiling for Android ARMv8 (aarch64)
[PHP] downloading 7.3.5... done!
[zlib] downloading 1.2.11... checking... compiling... installing... done!
[GMP] downloading 6.1.2... checking... compiling... installing... done!
[OpenSSL] downloading 1.1.0j... checking... compiling... installing... done!
[cURL] downloading curl-7_64_1... checking... compiling... installing... done!
[YAML] downloading 0.2.2... checking... compiling... installing... done!
[libzip] downloading 1.5.2... checking... compiling... installing... done!
[PHP] Downloading additional extensions...
  pthreads: downloading 17c9966bac59211da0705166fc0ecb5ecbc96a0d... done!
  yaml: downloading 2.0.4... done!
  igbinary: downloading 3.0.1... done!
  ds: downloading 4bb4be24ce9835ca81be2e48f0104683e41bce12... done!
  recursionguard: downloading d6ed5da49178762ed81dc0184cd34ff4d3254720... done!
  crypto: downloading 5f26ac91b0ba96742cc6284cd00f8db69c3788b2... done!
[PHP] enabling optimizations... checking...[daisukedaisuke@localhost php-build-scripts]$ 

cmake version

cmake --version
cmake version 3.14.3

Error(install.log)

checking for zip_open in -lzip... no
configure: error: could not find usable libzip

install.log
install.log

compile.sh

most of aarch64 gcc are not support '-m64' flag,,,check it~,should add sum judge string........

Error when starting server?

./bin/php7/bin/php: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

Maybe you can help me, please? Thank you!

Add iOS aarch64 cross-compile

I expect to run pmmp on iOS. So I want to run php7 on ios first.

Is there anyone who can help me with debugging, I am not very familiar with the compiler script.
I found some related scripts that are compiled php5 for ios.


#!/bin/bash

# NOTE: PHP thinks "finite" is available, but it's not. You have to disable it manually in the config.h file.

PLATFORM=iPhoneOS # iPhoneSimulator # iPhoneOS
HOST=arm-apple-darwin10 # i386-apple-darwin10 # arm-apple-darwin10
ARCH=armv7s # i386 # armv7s #armv7
SDK_VERSION=7.0

XCODE_ROOT=`xcode-select -print-path`
PLATFORM_PATH=$XCODE_ROOT/Platforms/$PLATFORM.platform/Developer
SDK_PATH=$PLATFORM_PATH/SDKs/$PLATFORM$SDK_VERSION.sdk
FLAGS="-isysroot $SDK_PATH -arch $ARCH -miphoneos-version-min=$SDK_VERSION" # -miphoneos-version-min=$SDK_VERSION -mios-simulator-version-min=$SDK_VERSION"
PLATFORM_BIN_PATH=$XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin
CC=$PLATFORM_BIN_PATH/clang
CXX=$PLATFORM_BIN_PATH/clang++
CFLAGS="$FLAGS -std=gnu99"
CXXFLAGS="$FLAGS -std=gnu++11 -stdlib=libc++"
LDFLAGS=$FLAGS

export CC CXX CFLAGS CXXFLAGS LDFLAGS

CONFIGURE_FLAGS="--host=$HOST --enable-embed=static --without-pear --disable-opcache --without-iconv --disable-cgi --disable-shared --disable-cli --enable-mysqlnd --with-pdo-mysql --with-mysqli --with-mysql --with-tsrm-pthreads"
./configure $CONFIGURE_FLAGS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.