Applicable environment: 64-bit Linux
Download Address (18MB): http://pan.baidu.com/s/1ntsrU8x
Md5sum PHP-7.0.0-DEV-20150502.TAR.XZ
5a4897aedc5ccf02da1f0340ac6013cb
PHP version is 7.0.0 development version, the code downloaded from GitHub on May 2, 2015.
Https://github.com/php/php-src/archive/master.zip
To create a user: sudo groupadd-r png
sudo useradd-r-G png-s/usr/sbin/nologin-d/png/nonexistent-c "PNG user" png
Create directory settings permissions and unzip: sudo mkdir/png && sudo chown $USER: $USER/png
Tar xjf php-7.0.0-dev-20150502.tar.xz-c/
The./buildconf generates a configure file.
Export cflags= "-o3" turns on O3 compilation optimizations, resulting in smaller executables and higher performance.
The./configure_php.sh executes configure, and the script content is below.
sudo mkdir/png && sudo chown $USER: $USER/png
Make && make 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 the traditional init service script, and Php-fpm.service is the SYSTEMD service script.
To make PHP cross the Linux distribution, you need to find out that PHP relies on the shared libraries packaged with PHP, the script pack.sh as follows:
Create/png/pack/libs and/png/pack/backup these directories beforehand.
pack.sh #!/bin/bash
#运行 cd/png/pack &&./pack.sh
Php=/png/php/7.0.0-dev
#复制依赖库.
For i in ' cat bin_lib.txt '; Do
for j in $i; Do
List= "$ (ldd $j | awk-f" "' {print $} ' |grep '. so ')"
for k in $list; Do
Cp-n "$k"/png/pack/libs
Done
Done
Done
#设置二进制和共享库的rpath和interpreter
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
#打包库和修改后的程序
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.