码迷,mamicode.com
首页 > Web开发 > 详细

Linux下编译安装php

时间:2016-01-06 15:56:04      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

1.安装依赖文件:

  yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gd gd2 gd-devel gd2-devel perl-CPAN pcre-devel

2.下载php源代码:

  wget http://us3.php.net/get/php-5.5.20.tar.gz/from/cn2.php.net/mirror

  tar -xvf php-5.5.20.tar.gz

  cd php-5.5.20

3.错误案例:configure: error: mcrypt.h not found. Please reinstall libmcrypt

  wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz

  tar -zxvf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7

  ./configure prefix=/usr/local/libmcrypt/

4.编译安装:

  ./configure --prefix=/usr/local/php --with-config-file-path=/etc/php --enable-fpm --enable-pcntl --enable-mysqlnd --enable-opcache --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --enable-zip --enable-ftp --enable-soap --enable-xml --enable-mbstring --disable-rpath --disable-debug --disable-fileinfo --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pcre-regex --with-iconv --with-zlib --with-mcrypt --with-gd --with-openssl --with-mhash --with-xmlrpc --with-curl --with-imap-ssl

   make

  make install

  cp php.ini-development /etc/php/

5.添加环境变量:

  vi /etc/profile

  PATH=/usr/local/php/bin:$PATH

  export PATH(末尾添加)

 

 

 

Linux下编译安装php

标签:

原文地址:http://www.cnblogs.com/netRob/p/5105564.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!