Decompress the package and use it in a cross-Linux PHP7 package environment: 64-bit Linux
(18 MB): http://pan.baidu.com/s/1ntsrU8x
Md5sum php-7.0.0-dev-20150502.tar.xz
5a4897aedc5ccf02da1f0340ac6013cb
PHP is developed in version 7.0.0 and downloaded from Github in May 2, 2015.
Https://github.com/php/php-src/archive/master.zip
Create a directory, set permissions, and decompress the package: Sudo mkdir/png & sudo chown $ USER: $ USER/png
Tar xJf php-7.0.0-dev-20150502.tar.xz-C/
./Buildconf generate the configure file.
Export CFLAGS = "-O3" enables O3 compilation optimization. the generated executable file is smaller and the performance is higher.
./Configure_php.sh execute configure, and the script content is below.
Sudo mkdir/png & sudo chown $ USER: $ USER/png
Make & make install compile and install PHP.
Configuration File:
Cp/png/src/php-7.0.0-dev-20150502/php. ini-*/png/php/7.0.0-dev/lib/
Cp/png/php/7.0.0-dev/lib/php. ini-production/png/php/7.0.0-dev/lib/php. ini
Cp/png/php/7.0.0-dev/etc/php-fpm.conf.default/png/php/7.0.0-dev/etc/php-fpm.conf
Cp/png/php/7.0.0-dev/etc/php-fpm.d/www. conf. default/png/php/7.0.0-dev/etc/php-fpm.d/www. conf
PHP-FPM service management script:
Cp/png/src/php-7.0.0-dev-20150502/sapi/fpm/init. d. php-fpm/png/php/7.0.0-dev/png-fpm
Cp/png/src/php-7.0.0-dev-20150502/sapi/fpm/php-fpm.service/png/php/7.0.0-dev/
Init. d. php-fpm is a traditional init service script, while php-fpm.service is the service script of systemd.
To make PHP cross-Linux releases, you need to find out the shared library on which PHP depends and pack it with PHP. the script pack. sh is as follows:
Create/png/pack/libs and/png/pack/backup directories in advance.
Pack. sh #! /Bin/bash
# Run cd/png/pack &./pack. sh
PHP =/png/php/7.0.0-dev
# Back up original files
Tar czf/png/pack/backup/php. tgz $ PHP
# Copy the library linker
Cp/lib64/ld-linux-x86-64.so.2/png/pack/libs
# Copy the dependent database.
For I in 'cat bin_lib.txt '; do
For j in $ I; do
List = "$ (ldd $ j | awk-F" "'{print $3}' | grep '. so ')"
For k in $ list; do
Cp-n "$ k"/png/pack/libs
Done
Done
Done
# Set the rpath and interpreter of binary and shared libraries
For I in 'cat bin_lib.txt '; do
/Png/pack/patchelf -- set-rpath/png/pack/libs -- force-rpath $ I
/Png/pack/patchelf -- set-interpreter/png/pack/libs/ld-linux-x86-64.so.2 $ I
Done
# Package Library and modified program
Tar cJf/png/pack/png.tar. xz/png/pack/libs $ PHP
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.