├── LICENSE ├── README.md └── install.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016-2019 iTX Technologies 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Build [PHP](https://secure.php.net) for [SimpleFramework](https://github.com/iTXTech/SimpleFramework) 2 | 3 | The recommended [PHP](https://secure.php.net) environment for running [SimpleFramework](https://github.com/iTXTech/SimpleFramework). 4 | 5 | Features: 6 | 7 | 1. Thread Safe 8 | 1. Integrated extensions: `sodium`, `gd` and more 9 | 1. Extended extensions: `swoole`, `yaml`, `pthreads`, `runkit7` and `zip` 10 | 11 | ## Build on Linux 12 | 13 | ### Dependencies 14 | 15 | * For Debian-based distros: `libssl-dev autoconf pkg-config curl libedit-dev libsqlite3-dev libxml2-dev libcurl4-openssl-dev libyaml-dev libzip-dev libgmp-dev libsodium-dev libjpeg-dev libpng-dev libwebp-dev libfreetype6-dev` 16 | * For RPM-based-distros: `autoconf pkg-config curl libedit-devel libsqlite3-devel libxml2-devel libyaml-devel libcurl-devel libzip-last-devel gmp-devel` and more 17 | 18 | * If you are using Ubuntu 17.04, configure can not locate the libcurl, so you need to `sudo ln -s /usr/include/x86_64-linux-gnu/curl /usr/include` 19 | 20 | ### Install system wide 21 | 22 | `$ curl -fsSL https://raw.githubusercontent.com/iTXTech/php-build-scripts/master/install.sh | bash` 23 | 24 | ### Customize your install script 25 | 26 | ```bash 27 | $ wget https://raw.githubusercontent.com/iTXTech/php-build-scripts/master/install.sh 28 | $ nano install.sh #modify something, like changing DL to aria2c -s16 -x16 29 | $ bash install.sh 30 | ``` 31 | 32 | ## Build on macOS 33 | 34 | 1. Install dependencies using [homebrew](https://brew.sh/) 35 | 1. You will have to specify the location of libraries in `install.sh` 36 | 37 | ## Windows Binary 38 | 39 | See [releases](https://github.com/iTXTech/php-build-scripts/releases) 40 | 41 | **Note that `swoole` cannot run on Windows, use WSL instead.** 42 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PREFIX=/usr/local 4 | SUDO=sudo 5 | DL=wget 6 | PROXYCHAINS= 7 | 8 | PHP_VERSION=7.3.13 9 | YAML_VERSION=2.0.4 10 | ZIP_VERSION=1.15.5 11 | RUNKIT7_VERSION=3.1.0a1 12 | MONGODB_VERSION=1.6.1 13 | 14 | set -e 15 | 16 | mkdir -p temp 17 | cd temp 18 | 19 | $PROXYCHAINS $DL http://www.php.net/distributions/php-$PHP_VERSION.tar.xz 20 | tar -xJf php-$PHP_VERSION.tar.xz 21 | cd php-$PHP_VERSION 22 | 23 | ./configure \ 24 | --disable-cgi \ 25 | --enable-mbstring \ 26 | --enable-bcmath \ 27 | --enable-pdo \ 28 | --with-pdo-mysql \ 29 | --with-sodium \ 30 | --enable-sockets \ 31 | --with-curl \ 32 | --with-libedit \ 33 | --with-openssl \ 34 | --with-zlib \ 35 | --with-gmp \ 36 | --with-gd \ 37 | --with-jpeg-dir \ 38 | --with-webp-dir \ 39 | --with-png-dir \ 40 | --with-freetype-dir \ 41 | --enable-pcntl \ 42 | --enable-maintainer-zts \ 43 | --prefix="$PREFIX" 44 | 45 | make -j`nproc` 46 | $SUDO make install 47 | cd .. 48 | 49 | $PROXYCHAINS git clone https://github.com/krakjoe/pthreads.git --depth=1 50 | cd pthreads 51 | phpize 52 | ./configure 53 | make -j`nproc` 54 | $SUDO make install 55 | cd .. 56 | 57 | $PROXYCHAINS $DL https://pecl.php.net/get/mongodb-$MONGODB_VERSION.tgz 58 | tar -zxf mongodb-$MONGODB_VERSION.tgz 59 | cd mongodb-$MONGODB_VERSION 60 | phpize 61 | ./configure 62 | make -j`nproc` 63 | $SUDO make install 64 | cd .. 65 | 66 | $PROXYCHAINS $DL https://pecl.php.net/get/yaml-$YAML_VERSION.tgz 67 | tar -zxf yaml-$YAML_VERSION.tgz 68 | cd yaml-$YAML_VERSION 69 | phpize 70 | ./configure 71 | make -j`nproc` 72 | $SUDO make install 73 | cd .. 74 | 75 | $PROXYCHAINS $DL https://pecl.php.net/get/zip-$ZIP_VERSION.tgz 76 | tar -zxf zip-$ZIP_VERSION.tgz 77 | cd zip-$ZIP_VERSION 78 | phpize 79 | ./configure 80 | make -j`nproc` 81 | $SUDO make install 82 | cd .. 83 | 84 | $PROXYCHAINS $DL https://pecl.php.net/get/runkit7-$RUNKIT7_VERSION.tgz 85 | tar -zxf runkit7-$RUNKIT7_VERSION.tgz 86 | cd runkit7-$RUNKIT7_VERSION 87 | phpize 88 | ./configure 89 | make -j`nproc` 90 | $SUDO make install 91 | cd .. 92 | 93 | echo "phar.readonly = off 94 | extension = yaml.so 95 | extension = pthreads.so 96 | extension = mongodb.so 97 | extension = runkit7.so 98 | extension = zip.so 99 | zend_extension = opcache.so 100 | zend.assertions = -1 101 | " | $SUDO tee "$PREFIX/lib/php.ini" > /dev/null 102 | 103 | cd .. 104 | rm -rf temp 105 | --------------------------------------------------------------------------------