1,背景

在现有的ubuntu16.04中,装了好几个版本的PHP

/etc/php/

5.6/ 7.0/ 7.1/ 7.2/ 7.3/

whereis php

php: /usr/bin/php7.3 /usr/bin/php7.0 /usr/bin/php /usr/lib/php /etc/php /usr/include/php

/usr/share/php7.3-bcmath /usr/share/php7.3-readline /usr/share/php7.3-zip

/usr/share/php7.0-common /usr/share/php7.0-opcache

/usr/share/php7.3-ldap /usr/share/php7.3-opcache /usr/share/php7.3-xml /usr/share/php7.3-mysql

/usr/share/php7.3-json /usr/share/php7.3-gd

/usr/share/php7.0-json /usr/share/php /usr/share/php7.3-curl /usr/share/php7.3-mbstring /usr/share/php7.0-mcrypt /usr/share/php7.3-common

/usr/share/php7.0-readline /usr/share/php7.3-xmlrpc /usr/share/man/man1/php.1.gz

sudo update-alternatives --config php

There are 2 choices for the alternative php (providing /usr/bin/php).

Selection Path Priority Status

------------------------------------------------------------

0 /usr/bin/php7.3 73 auto mode

1 /usr/bin/php7.0 70 manual mode

* 2 /usr/bin/php7.3 73 manual mode

Press to keep the current choice[*], or type selection number:

php -v

PHP 7.3.6-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 31 2019 11:06:26) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies

with Zend OPcache v7.3.6-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

但是phpize却一直是老的版本

whereis phpize

phpize: /usr/bin/phpize7.0 /usr/bin/phpize /usr/share/man/man1/phpize.1.gz

phpize

Configuring for:

PHP Api Version: 20151012

Zend Module Api No: 20151012

Zend Extension Api No: 320151012

phpize7.0

Configuring for:

PHP Api Version: 20151012

Zend Module Api No: 20151012

Zend Extension Api No: 320151012

当前PHP版本是7.3,而编译器时7.0版本,当要编译安装一些7.0以上版本时,就报错,如下:

cd swoole-src &&

phpize &&

Configuring for:

PHP Api Version: 20151012

Zend Module Api No: 20151012

Zend Extension Api No: 320151012

./configure &&

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /bin/grep -E

checking for a sed that does not truncate output... /bin/sed

checking for cc... cc

checking whether the C compiler works... yes

...

config.status: creating config.h

config.status: config.h is unchanged

config.status: executing libtool commands

make && sudo make install

/bin/bash /opt/wwwroot/swoole/libtool --mode=compile g++ -I. -I/opt/wwwroot/swoole -DPHP_ATOM_INC -I/opt/wwwroot/swoole/include -I/opt/wwwroot/swoole/main -I/opt/wwwroot/swoole -I/usr/include/php/20151012

-I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib

-I/opt/wwwroot/swoole -I/opt/wwwroot/swoole/include -I/opt/wwwroot/swoole/thirdparty/hiredis -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /opt/wwwroot/swoole/php_swoole_cxx.cc -o php_swoole_cxx.lo

libtool: compile: g++ -I. -I/opt/wwwroot/swoole -DPHP_ATOM_INC -I/opt/wwwroot/swoole/include -I/opt/wwwroot/swoole/main -I/opt/wwwroot/swoole -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/opt/wwwroot/swoole -I/opt/wwwroot/swoole/include -I/opt/wwwroot/swoole/thirdparty/hiredis -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /opt/wwwroot/swoole/php_swoole_cxx.cc -fPIC -DPIC -o .libs/php_swoole_cxx.o

In file included from /opt/wwwroot/swoole/php_swoole_cxx.h:19:0,

from /opt/wwwroot/swoole/php_swoole_cxx.cc:1:

/opt/wwwroot/swoole/php_swoole.h:123:2: error: #error "require PHP version 7.1 or later"

#error "require PHP version 7.1 or later"

^

Makefile:194: recipe for target "php_swoole_cxx.lo" failed

make: *** [php_swoole_cxx.lo] Error 1

所以,需要为7.1或者7.3安装phpize,我们这里就以7.3为例了。

2,安装

直接执行命令

sudo apt-get install php7.3-dev

执行中

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following package was automatically installed and is no longer required:

snapd-login-service

Use "sudo apt autoremove" to remove it.

The following additional packages will be installed:

libapache2-mod-php7.3 libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev libpcre2-posix2 php7.3-bcmath php7.3-cli php7.3-common php7.3-curl php7.3-fpm php7.3-gd php7.3-json php7.3-ldap

php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-readline php7.3-xml php7.3-xmlrpc php7.3-zip

Suggested packages:

dh-php

The following NEW packages will be installed:

libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix2 php7.3-dev

The following packages will be upgraded:

libapache2-mod-php7.3 libpcre2-8-0 php7.3-bcmath php7.3-cli php7.3-common php7.3-curl php7.3-fpm php7.3-gd php7.3-json php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-readline

php7.3-xml php7.3-xmlrpc php7.3-zip

17 upgraded, 5 newly installed, 0 to remove and 119 not upgraded.

Need to get 7,860 kB of archives.

After this operation, 9,513 kB of additional disk space will be used.

Do you want to continue? [Y/n] Y

需要空间,问是否继续,Y

Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.3-zip amd64 7.3.18-1+ubuntu16.04.1+deb.sury.org+1 [20.3 kB]

Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.3-json amd64 7.3.18-1+ubuntu16.04.1+deb.sury.org+1 [18.0 kB]

...

Setting up php7.3-cli (7.3.18-1+ubuntu16.04.1+deb.sury.org+1) ...

由于原先已经安装了php7.3版本,所以会弹窗,询问对php.ini文件的处理

一般会选择的第二个,保留已安装过的版本。但是我自己想用新的,所以选了第一个。

Installing new version of config file /etc/init.d/php7.3-fpm ...

接着又询问关于 php-fpm.conf (也会上面的弹框)

以及 www.conf 配置文件的处理:

Configuration file "/etc/php/7.3/fpm/pool.d/www.conf"

==> Modified (by you or by a script) since installation.

==> Package distributor has shipped an updated version.

What would you like to do about it ? Your options are:

Y or I : install the package maintainer"s version

N or O : keep your currently-installed version

D : show the differences between the versions

Z : start a shell to examine the situation

The default action is to keep your current version.

*** www.conf (Y/I/N/O/D/Z) [default=N] ? Y

这边仍然选择重新安装。

Installing new version of config file /etc/php/7.3/fpm/pool.d/www.conf ...

Replacing config file /etc/php/7.3/fpm/php.ini with new version

NOTICE: Not enabling PHP 7.3 FPM by default.

NOTICE: To enable PHP 7.3 FPM in Apache2 do:

NOTICE: a2enmod proxy_fcgi setenvif

NOTICE: a2enconf php7.3-fpm

NOTICE: You are seeing this message because you have apache2 package installed.

.

.

.

NOTICE: Not enabling PHP 7.3 FPM by default.

NOTICE: To enable PHP 7.3 FPM in Apache2 do:

NOTICE: a2enmod proxy_fcgi setenvif

NOTICE: a2enconf php7.3-fpm

NOTICE: You are seeing this message because you have apache2 package installed.

看一下phpize

whereis phpize

phpize: /usr/bin/phpize7.0 /usr/bin/phpize /usr/bin/phpize7.3 /usr/share/man/man1/phpize.1.gz

phpize7.3

Configuring for:

PHP Api Version: 20180731

Zend Module Api No: 20180731

Zend Extension Api No: 320180731

autoconf: warning: both `configure.ac" and `configure.in" are present.

autoconf: warning: proceeding with `configure.ac".

autoheader: "configure.ac" and "configure.in" both present.

autoheader: proceeding with "configure.ac"

已经安装好了。

php7 phpize,安装phpize7.3相关推荐

  1. php7 编译安装,添加扩展 pdo /usr/local/php/bin/phpize 发现没有 configure

    2019独角兽企业重金招聘Python工程师标准>>> php7 编译安装,添加扩展  /usr/local/php/bin/phpize   发现没有 configure 解决办法 ...

  2. php7.1 phpize编译gd,centos 7 下用 phpize安装GD扩展库

    yum 安装 开启GD库需要的模块 freetype ,jpegsrc,libpng 用phpize安装 查询php 开启模块 查询 phpize扩展安装 下载目录:/usr/src/freetype ...

  3. php7.1解压包安装,【Swoole】php7.1安装swoole扩展

    参照:https://zixuephp.net/article-430.html 1.源码编译安装,PHP版本7.1.33 2.在已经编译好安装的php7.1中安装swoole扩展. 一.下载swoo ...

  4. PHP7.1安装yaf扩展

    PHP71安装yaf扩展 把PHP命令加到系统 下载Yaf扩展包 安装 PHP7.1安装yaf扩展 把PHP命令加到系统 我的PHP安装目录是/usr/local/webserver/php,所以ph ...

  5. php 7.1 openssl安装,介绍 php7.1 安装openssl扩展,php openssl

    介绍 php7.1 安装openssl扩展介绍php7.1安装心脏出血扩展,PHP7栏目介绍php7.1 安装openssl扩展的方法 推荐(免费):PHP7 在安装(同脉冲亮度分析仪)脉冲振幅分析器 ...

  6. centos php支持yaf,CentOS环境下给PHP7.0安装yaf扩展

    | CentOS环境下给PHP7.0安装yaf扩展 在CentOS环境下给PHP7.0安装yaf扩展,首先要知道PHP的安装目录在哪里,以我当前的路径为例,在/usr/local/php目录下. 下一 ...

  7. php7如何安装swoole,PHP7如何安装Swoole?

    PHP7如何安装Swoole? 发布时间:2020-05-19 16:35:02 来源:亿速云 阅读:135 作者:Leah 这篇文章给大家分享的是PHP7安装Swoole的详细安装教程,相信大部分人 ...

  8. PHP7 下安装 memcache 和 memcached 扩展

    转载自:https://www.jianshu.com/p/c06051207f6e Memcached 是高性能的分布式内存缓存服务器,而PHP memcache 和 memcached 都是 Me ...

  9. php7 libevent扩展,php7下安装event扩展方法

    有效安排I/O,时间和信号的扩展 使用可用于特定平台的最佳I/O通知机制的事件,是PHP基础设施的libevent端口. 下载地址:http://pecl.php.net/package/event ...

最新文章

  1. java 窗口开始_Java窗口(JFrame)从零开始(3)——绝对布局
  2. 史上最简单的SpringCloud教程 | 第四篇:断路器(Hystrix)
  3. php domdocument getelementbyid,PHP DOMDocument- getElementByID添加Â代替空
  4. 2020年短视频及电商直播趋势报告
  5. 阿里云服务器被挖矿minerd入侵的解决办法,导致tomcat启动很慢
  6. Jumpserver0.4.0基于Centos7安装
  7. 在 Mac 上用输入法如何以另一种语言键入?
  8. C:\Program Files (x86)\SogouInput\Components\程序异常结束 ,QT
  9. 装箱问题 vijos
  10. 内存带宽测试工具-Stream
  11. 不能随便输入的“netsh winsock reset”
  12. NYOJ 20 吝啬的国度
  13. 关于护肤那些事(程序员必知,女朋友要考的)
  14. dota游戏之我之见
  15. 《笑傲江湖》一共有几个版本? -- 影评
  16. php网页访问usb驱动,PHP调用http接口
  17. Ubuntu18.04安装Cmake(最新最详细亲测)
  18. 华帝30年:文化是发展的深层力量
  19. php表单输入内容换行,PHP获取表单textarea数据换行用法示例
  20. Java重载时的参数匹配原则

热门文章

  1. 【生存分析】参数模型 - 加速失效(AFT)模型
  2. 亚马逊在南加州推行自动送货机器人【智能快讯】
  3. AOP学习之一 -- CGLIB使用介绍
  4. keytool -exportcert -alias key0 -keystore key.jks | openssl sha1 -binary | openssl base64--生成28位加密签名
  5. 蓝牙进阶之路 (003) - AT指令(转)
  6. 运算放大器工作原理及选择
  7. 37 | 高速缓存(上):“4毫秒”究竟值多少钱?
  8. java字符数组转字符串,java数组转字符串
  9. 健身需要什么装备?这几种你可别遗漏了!
  10. 弘辽科技:网店卖女装好还是日用百货好?网店有何技巧?