• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

【安装PHP】怎么在openSUSE42.1下编译安装PHP7

php 搞代码 3年前 (2022-01-24) 33次浏览 已收录 0个评论
文章目录[隐藏]

【安装PHP】如何在openSUSE42.1下编译安装PHP7

首先推荐一篇文章PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? – PHP Classes blog。

里面说到是否会去使用PHP7,就个人而言,我是毫不犹豫地使用的,但是生产环境就不是我说了算,所以只能自己在自己的开发环境里更新PHP的版本。那么,你¥本文来源gaodai#ma#com搞@@代~&码网^搞gaodaima代码呢?

笔者使用的是Linux的openSUSE42.1发行版,Yast里面还没有PHP7的安装包,于是乎只能自己手动编译安装了。作为一个PHP开发者,我是非常希望能够学会编译安装PHP7的,之前试过几次,但是每次安装都要上网找各种资料,于是乎,这次安装成功后就想把自己的安装过程以及遇到的问题记录下来,方便以后查阅和分享给需要的人。

下载源码并解压

进入正题,要编译安装PHP7,首先当然要下载PHP7的源码。你可以到github上clone,也可以到PHP官网下载。下载后解压到 /usr/local/src 目录,并将目录重命名为php7。进入目录。

配置编译参数

生成配置文件

./buildconf

配置

./<span style="color: #000000">configure \</span>--prefix=/usr/local/<span style="color: #000000">php7 \</span>--exec-prefix=/usr/local/<span style="color: #000000">php7 \</span>--bindir=/usr/local/php7/<span style="color: #000000">bin \</span>--sbindir=/usr/local/php7/<span style="color: #000000">sbin \</span>--includedir=/usr/local/php7/<span style="color: #000000">include \</span>--libdir=/usr/local/php7/lib/<span style="color: #000000">php \</span>--mandir=/usr/local/php7/php/<span style="color: #0000ff">man</span><span style="color: #000000"> \</span>--with-config-<span style="color: #0000ff">file</span>-path=/usr/local/php7/<span style="color: #000000">etc \</span>--with-mysql-sock=/var/run/mysql/<span style="color: #000000">mysql.sock \</span>--with-mcrypt=/usr/<span style="color: #000000">include \</span>--with-<span style="color: #000000">mhash \</span>--with-<span style="color: #000000">openssl \</span>--with-mysqli=<span style="color: #000000">shared,mysqlnd \</span>--with-pdo-mysql=<span style="color: #000000">shared,mysqlnd \</span>--with-<span style="color: #000000">gd \</span>--with-<span style="color: #000000">iconv \</span>--with-<span style="color: #000000">zlib \</span>--enable-<span style="color: #0000ff">zip</span><span style="color: #000000"> \</span>--enable-inline-<span style="color: #000000">optimization \</span>--disable-<span style="color: #000000">debug \</span>--disable-<span style="color: #000000">rpath \</span>--enable-<span style="color: #000000">shared \</span>--enable-<span style="color: #000000">xml \</span>--enable-<span style="color: #000000">bcmath \</span>--enable-<span style="color: #000000">shmop \</span>--enable-<span style="color: #000000">sysvsem \</span>--enable-<span style="color: #000000">mbregex \</span>--enable-<span style="color: #000000">mbstring \</span>--enable-<span style="color: #0000ff">ftp</span><span style="color: #000000"> \</span>--enable-gd-native-<span style="color: #000000">ttf \</span>--enable-<span style="color: #000000">pcntl \</span>--enable-<span style="color: #000000">sockets \</span>--with-<span style="color: #000000">xmlrpc \</span>--enable-<span style="color: #000000">soap \</span>--without-<span style="color: #000000">pear \</span>--with-<span style="color: #000000">gettext \</span>--enable-<span style="color: #000000">session \</span>--with-<span style="color: #000000">curl \</span>--with-jpeg-<span style="color: #0000ff">dir</span><span style="color: #000000"> \</span>--with-freetype-<span style="color: #0000ff">dir</span><span style="color: #000000"> \</span>--enable-<span style="color: #000000">opcache \</span>--enable-<span style="color: #000000">fpm \</span>--disable-<span style="color: #000000">cgi \</span>--with-fpm-user=<span style="color: #000000">nginx \</span>--with-fpm-group=<span style="color: #000000">nginx \</span>--without-<span style="color: #000000">gdbm \</span>--disable-fileinfo


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:【安装PHP】怎么在openSUSE42.1下编译安装PHP7
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址