php7源码安装

1.php官方下载地址:https://www.php.net/downloads.php

1.php7官方源码下载地址:https://www.php.net/distributions/php-7.1.9.tar.bz2

2.解压压缩包  tar -xjvf php-7.1.9.tar.bz2

3.php安装路径  ./configure --prefix=/mnt/h/swoole/php7.1.9/php

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mysqlnd-compression-support --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-intl --with-mcrypt --with-libmbfl --enable-ftp --with-gd --enable-gd-jis-conv --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --with-pear --enable-maintainer-zts --with-ldap=shared --without-gdbm

4. 安装请确保已经安装GCC ,autoconfig 没有请自行根据linux ubuntu 安装

5. make test  检测安装环境

6. make install  安装  

 

[PEAR] Archive_Tar - already installed: 1.4.3
[PEAR] Console_Getopt - already installed: 1.4.1
[PEAR] Structures_Graph- already installed: 1.1.1
[PEAR] XML_Util - already installed: 1.4.2
[PEAR] PEAR - already installed: 1.10.5
Wrote PEAR system config file at: /mnt/h/swoole/php7.1.9/php/etc/pear.conf
You may want to add: /mnt/h/swoole/php7.1.9/php/lib/php to your php.ini include_path
/mnt/h/swoole/php7.1.9/php-7.1.9/build/shtool install -c ext/phar/phar.phar /mnt/h/swoole/php7.1.9/php/bin
ln -s -f phar.phar /mnt/h/swoole/php7.1.9/php/bin/phar
Installing PDO headers: /mnt/h/swoole/php7.1.9/php/include/php/ext/pdo/

显示上面 即为安装成功

转到php  安装bin目录  

./bin/php -m  查看php安装扩展

简化php运行命令

vi ~/.bash_profile 编辑文件
输入 alias sphp7=/mnt/h/swoole/php7.1.9/php/bin/php  alias 别名  = php bin目录
source ~/.bash_profile 生效配置

测试 sphp7 - v  显示下面即为成功

PHP 7.1.9 (cli) (built: Aug 23 2020 18:38:42) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

到php解压目录找到php.ini-development 复制到php安装目录的lib目录去,具体路径看编译php时是否指定路径,默认为lib 重命名为php.ini,sphp7 -i | grep php.ini  找到当前php配置的ini路径 把php.ini 移到相应目录。

 

posted @ 2020-08-23 23:58  5656923  阅读(322)  评论(0)    收藏  举报