PHP7安装

PHP7安装步骤

下载php7

官网地址:http://php.net/get/php-7.0.7.tar.bz2/from/a/mirror

安装依赖

分别安装

  1. apt-get install build-essential
  2. apt-get install openssl
  3. apt-get install curl
  4. apt-get install libcurl4-gnutls-dev
  5. apt-get install libjpeg-dev
  6. apt-get install libpng-dev
  7. apt-get install libmcrypt-dev
  8. apt-get install libreadline6 libreadline6-dev
  9. apt-get install pkg-config
  10. apt-get install libfreetype6-dev

一条命令

apt-get install build-essential openssl curl libcurl4-gnutls-dev libjpeg-dev libpng-dev libmcrypt-dev libreadline6 libreadline6-dev pkg-config libfreetype6-dev

configure

./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7etc --enable-fpm --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache --with-mysqli --with-mysql-sock --enable-pdo --with-pdo-mysql --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear --with-libdir=/lib/x86_64-linux-gnu --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --enable-xml --with-apxs2=/usr/local/apache2/bin/apxs

make

  • make && make install
  • 注意:如果make过了重新make一定要先make clean,否则会make失败

把配置文件拷过去

cp ./php.ini-production /usr/local/php7/etc/php.ini

环境变量配置

  • 在etc/profile添加
  • PATH=${PATH}:/usr/local/php/bin
  • source /etc/profile

配置httpd

  • LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so
  • <FilesMatch .php$>
  • SetHandler application/x-httpd-php
  • </FilesMatch>

转载于:https://my.oschina.net/patrickwangqy/blog/689516

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值