PHP 原始碼編譯安裝(李作強)

2021-08-22 11:58:32 字數 3404 閱讀 6521

yum install

yum -y install libcurl-devel

yum install -y epel-release

yum install -y libmcrypt-devel

useradd -s /sbin/nologin www

yum install libmcrypt libmcrypt-devel libxml2 libxml2-devel \

zlib zlib-devel gd gd-devel freetype

cd /opt

wget

tar zxvf php-5.4.19.tar.gz

cd php-5.4.19

./configure \

–prefix=/usr/local/php-5.4.19 \

–enable-fpm \

–with-fpm-user=www \

–with-fpm-group=www \

–with-iconv \

–with-mysql \

–enable-mbstring \

–with-curl \

–with-zlib \

–enable-pcntl \

–enable-sysvsem \

–enable-sysvshm \

–with-jpeg-dir \

–with-png-dir \

–with-freetype-dir \

–with-gd \

–enable-sockets \

–enable-gd-native-ttf \

–with-pear \

–enable-bcmath \

–enable-exif \

–with-mcrypt \

–with-mysqli \

–with-pdo-mysql \

–enable-zip \

–with-freetype-dir \

–with-iconv \

–with-ldap \

–with-ldap-sasl

–enable-soap \

–with-zlib-dir \

–with-openssl \

make && make install

ln -s /usr/local/php-5.4.19 /usr/local/php

cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod 755 /etc/init.d/php-fpm

cp php.ini-production /usr/local/php/lib/php.ini

cd /usr/local/php-5.4.19/etc

cp php-fpm.conf.default php-fpm.conf

yum install -y m4 autoconf

memcached 擴充套件安裝

yum install libevent memcached

cd /usr/local/php/bin/

./pecl install memcache

/usr/local/php-5.4.19/lib/php/extensions/no-debug-non-zts-20100525/memcache.so

imagemagick 擴充套件安裝

yum install imagemagick imagemagick-devel -y

cd /usr/local/php/bin

./pecl install imagick

/usr/local/php-5.4.19/lib/php/extensions/no-debug-non-zts-20100525/imagick.so

mongo 擴充套件安裝

wget

tar zxvf mongo-1.6.11.tgz

cd mongo-1.6.11

/usr/local/php/bin/phpize

./configure –with-php-config=/usr/local/php/bin/php-config

make && make install

opencc 擴充套件安裝 繁體簡體轉換

wget

tar zxvf ver.1.0.4.tar.gz

cd opencc-ver.1.0.4

yum install cmake -y

make && make install

yum update -y nss curl libcurl

git clone

cd opencc4php

/usr/local/php/bin/phpize

./configure –with-php-config=/usr/local/php/bin/php-config

make && make install

amqp 擴充套件安裝

yum install librabbitmq librabbitmq-devel librabbitmq-tools

cd /usr/local/php/bin

./pecl install amqp

yaf 擴充套件安裝

wget

tar zxvf yaf-2.3.4.tgz

cd yaf-2.3.4

/usr/local/php/bin/phpize

./configure –with-php-config=/usr/local/php/bin/php-config

make && make install

cd /usr/local/php/bin

./pecl install yaf

修改php.ini設定,新增擴充套件

vi /usr/local/php/lib/php.ini

extension_dir = 「/usr/local/php-5.4.19/lib/php/extensions/no-debug-non-zts-20100525/」

extension=memcache.so

extension=imagick.so

extension=mongo.so

extension=opencc.so

extension=amqp.so

extension=openssl.so //開啟openssl之後就不用安裝擴充套件庫。

[yaf]

extension = 「yaf.so」

啟動php

/etc/init.d/php-fpm start

原始碼編譯安裝php5 6

cd usr local src wget net get php 5.6 24.tar gz from this mirror mv mirror php 5.6 24.tar gztar zxvf php 5.6 24.tar gzcd php 5.6 24xml擴充套件 apt get ins...

PHP原始碼安裝

1.安裝libiconv tar zxvf libiconv 1.13.1.tar.gz cd libiconv 1.13.1 configure prefix usr local libiconv make make install 2.libmcrypt安裝 tar zxvf libmcrypt...

php原始碼安裝

php原始碼安裝。環境 centos7.6 建立了乙個user1使用者。1.1 php 7.3.7.tar.bz2 1.2 解壓 tar xjvf php 7.3.7.tar.bz2 home user1 study softpackage php 7.3.7 2 安裝gcc,autoconf 2....