CentOS X64 PHP5.4编译参数

CentOS 5/6 64位下tarball安装PHP5.4步骤
  • 安装EPEL仓库 https://fedoraproject.org/wiki/EPEL/FAQ#howtouse
    for CentOS6:  rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
    for CentOS5:  rpm -ivh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

  • 删除已有php包
    # yum remove php php-\*

  • 安装依赖包
    # yum install libtool-ltdl libtool-ltdl-devel openssl-devel curl-devel   \
          libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel \
          libc-client libc-client-devel  gd gd-devel libmcrypt libmcrypt-devel mcrypt \
          mysql-devel libicu libicu-devel pcre-devel \
          gpm gmp gmp-devel gcc gcc-c++ zlib zlib-devel glibc glibc-devel \
          glib2 glib2-devel bzip2 bzip2-devel krb5 krb5-devel libxml2 libxml2-devel p7zip \
          re2c bison bison-devel \
          libevent libenent-devel \

  • 添加php进程属主
    # useradd -M -s /bin/false www

  • 编译,安装
    # ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu \
    --with-layout=GNU --with-libdir=lib64 \
    --prefix=/usr/local --exec-prefix=/usr/local  \
    --sysconfdir=/etc  --libdir=/usr/local/lib64/php \
    --sbindir=/usr/local/sbin --sharedstatedir=/usr/com --datadir=/usr/local/share \
    --includedir=/usr/local/include --libexecdir=/usr/local/libexec \
    --localstatedir=/var --mandir=/usr/local/share/man --infodir=/usr/local/share/info \
    --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d \
    --with-pic  --with-curl=shared  --with-freetype-dir --with-png-dir  \
    --with-gettext=shared --with-gmp=shared --with-iconv --with-jpeg-dir --with-png-dir \
    --with-openssl --with-libxml-dir --with-pcre-regex \
    --with-mcrypt=shared --with-zlib  \
    --with-mysql --with-mysql-sock=/var/lib/mysql/mysql.sock \
    --with-mysqli --with-pdo-mysql \
    --with-pgsql=/usr/pgsql-9.1 --with-pdo-pgsql=/usr/pgsql-9.1 \
    --with-kerberos --with-imap --with-imap-ssl \
    --with-pear --with-gd --enable-gd-native-ttf --enable-calendar=shared \
    --enable-exif --enable-ftp --enable-sockets --enable-bcmath=shared \
    --enable-pcntl \
    --enable-intl --enable-mbstring \
    --enable-zip --with-bz2=shared \
    --enable-sysvsem --enable-sysvshm --enable-sysvmsg \
    --without-unixODBC --enable-mbregex \
    --enable-fpm  --with-fpm-user=www  --with-fpm-group=www \
    --disable-tokenizer --disable-phar \
    --without-sqlite3 --without-pdo-sqlite \

    # make && make install

    如果没安装postgresql9.1则删除相关参数

    安装有如下类似结果:
    Installing shared extensions:     /usr/local/lib64/php/20100525/
    Installing PHP CLI binary:        /usr/local/bin/
    Installing PHP CLI man page:      /usr/local/share/man/man1/
    Installing PHP FPM binary:        /usr/local/sbin/
    Installing PHP FPM config:        /etc/
    Installing PHP FPM man page:      /usr/local/share/man/man8/
    Installing PHP FPM status page:      /usr/local/share/fpm/
    Installing PHP CGI binary:        /usr/local/bin/
    Installing build environment:     /usr/local/lib64/php/build/
    Installing header files:          /usr/local/include/php/
    Installing helper programs:       /usr/local/bin/
      program: phpize
      program: php-config
    Installing man pages:             /usr/local/share/man/man1/
      page: phpize.1
      page: php-config.1
    Installing PEAR environment:      /usr/local/share/pear/
    [PEAR] Archive_Tar    - already installed: 1.3.7
    [PEAR] Console_Getopt - already installed: 1.3.0
    [PEAR] Structures_Graph- already installed: 1.0.4
    [PEAR] XML_Util       - already installed: 1.2.1
    [PEAR] PEAR           - already installed: 1.9.4
    Wrote PEAR system config file at: /etc/pear.conf
    You may want to add: /usr/local/share/pear to your php.ini include_path
    Installing PDO headers:          /usr/local/include/php/ext/pdo/






转载于:https://my.oschina.net/mark35/blog/76111

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值