Https://bitbucket.org/GregorR/musl-cross/downloads
CROSSX86-ARM-LINUX-MUSLEABI-0.9.11.TAR.XZ (20MB)
CC=ARM-LINUX-MUSLEABI-GCC \
cxx=arm-linux-musleabi-g++ \
Ar=arm-linux-musleabi-ar \
LD=ARM-LINUX-MUSLEABI-LD \
Ranlib=arm-linux-musleabi-ranlib \
Strip=arm-linux-musleabi-strip \
cflags= "-os" \
cxxflags= "-os" \
./configure \
--host=arm-linux-musleabi \
--prefix=/opt/phpdroid/php \
--disable-all \
--enable-json \
--ENABLE-PDO \
--with-sqlite3 \
--with-pdo-sqlite
The PHP source code comes with the Pcre library and does not depend on the external Pcre library at compile time, so you do not need to compile the Pcre library and configure the Cppflags and Ldflags parameters:
cppflags= "-i/png/dev/android/compiled/usr/include-i/png/dev/android/compiled/usr/usr/include" \
ldflags= "-static-l/png/dev/android/compiled/usr/lib-l/png/dev/android/compiled/usr/usr/lib" \
Sed-i "s{/bin/sh{/system/bin/sh{" ext/standard/proc_open.c
Sed-i "s{-export-dynamic{-all-static{" Makefile
Missing sed-i "s{-export-dynamic{-all-static{" Makefile after compiling:
./php-v return-bash:./php:no such file or directory
File./php returns php:elf 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
Normal should return php:elf 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
Time nice-20 Make-j2
Make install
arm-linux-musleabi-strip/opt/phpdroid/php/bin/php
Xz-z-k-9/opt/phpdroid/php/bin/php
Strip less than 4mb,xz after compression of about 1MB.
3.7MB smaller than the current PHP.XZ 2.7MB, phpdroid apk package can be reduced from 5.7MB to 3MB.
Download: Php-7.0.6-arm-linux.xz (1.1MB)
./php-m
[PHP Modules]
Core
Date
Json
Pcre
Pdo
Pdo_sqlite
Reflection
Spl
Sqlite3
Standard
./php-r ' Print_r (Get_defined_functions ()); ' > Func.txt
./php-r ' Print_r (get_declared_classes ()); ' > Class.txt
Visible includes some of the features that are commonly used below:
Pdo_sqlite
Json_encode/json_decode
File_get_contents/file_put_contents
Note: Without OpenSSL support, the file_put_contents is not supported by the HTTPS protocol.
./php-r "file_put_contents (' logo.gif ', file_get_contents (' https://www.baidu.com/img/bdlogo.gif '));"