在ARM上编译php
最近有一个需求是在arm上编译php5.5版本,记录一下。
其实在arm上编译php和在x86没有太大区别,主要是很多依赖都需要重新编译,这里拿openssl和curl举例。
编译openssl
wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1h.tar.gz
tar zxf openssl-1.0.1h.tar.gz
./config -fPIC --prefix=/usr/local/services/php/environment/openssl enable-shared
make
make install
编译curl
wget https://curl.se/download/curl-7.42.1.tar.gz
tar zxf curl-7.42.1.tar.gz
cd curl-7.42.1
./configure --without-nss --prefix=/usr/local/services/php/environment/curl -with-ssl=/usr/local/services/php/environment/openssl
make
make install
编译imagick
wget https://pecl.php.net/get/imagick-3.7.0.tgz
tar zxf imagick-3.7.0.tgz
cd imagick-3.7.0
/usr/local/services/php/bin/phpize
./configure --with-php-config=/usr/local/services/php/bin/php-config
make
make install
编译php
wget https://www.php.net/distributions/php-5.5.25.tar.gz
tar zxf php-5.5.25.tar.gz
cd php-5.5.25
./configure --prefix=/usr/local/services/php --with-config-file-path=/usr/local/services/php/etc --enable-opcache --enable-fpm --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --enable-xml --enable-pcntl --enable-sysvmsg --enable-sysvshm --enable-sysvsem --enable-sockets --enable-mbstring --enable-soap --enable-bcmath --enable-zip --with-curl=/usr/local/services/php/environment/curl --with-gmp --with-mcrypt=/usr/local/services/php/environment/libmcrypt --with-openssl=/usr/local/services/php/environment/openssl --with-jpeg-dir=/usr/local/services/php/environment/jpegsr8c --with-png-dir=/usr/local/services/php/environment/libpng --with-gd
make
make install
就这么简单(完)