search
HomeBackend DevelopmentPHP Tutorial[Installing PHP] How to compile and install PHP7 under openSUSE42.1, opensuse42.1php7_PHP tutorial

[Install PHP] How to compile and install PHP7 under openSUSE42.1, opensuse42.1php7

First recommend an article PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog.

It talks about whether I will use PHP7. Personally, I will use it without hesitation, but I don’t have the final say in the production environment, so I can only update the PHP version in my own development environment. . So, what about you?

The author is using the openSUSE42.1 distribution of Linux. There is no installation package for PHP7 in Yast, so I can only compile and install it manually. As a PHP developer, I really hope to learn how to compile and install PHP7. I have tried it several times before, but every time I install it, I have to go online to find various information. So, after the successful installation this time, I want to go through my own installation process. And record the problems encountered so that you can refer to them later and share them with those who need them.

Download the source code and unzip it

Getting to the point, to compile and install PHP7, you must first download the source code of PHP7. You can clone it on github or download it from the PHP official website. After downloading, extract it to the /usr/local/src directory and rename the directory to php7. Enter the directory.

Configure compilation parameters

Generate configuration file

./buildconf

Configuration

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

Parameter description

<p>prefix PHP7安装的根目录</p>
<p><em id="__mceDel">with-config-file-path PHP7的配置文件目录</em></p>

The result after executing the above configuration command is as shown below:

When executing the above command, you will encounter some prompts about missing dependencies. The dependency problems I encountered are listed below:

Error:

configure: error: xml2-config not found. Please check your libxml2 installation.

Solution:

zypper <span>install</span> libxml2-devel

Error:

configure: WARNING: unrecognized options: --with-mysql

Solution:

取消这个选项,这个选项是不存在的

Error:

configure: error: jpeglib.h not found.

Solution:

zypper <span>install</span> libjpeg-devel

Error:

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

Solution:

zypper <span>install</span> libmcrypt-devel

Error:

checking <span>for</span><span> recode support... yes
configure: error: Can not </span><span>find</span> recode.h anywhere under /usr /usr/local /usr /opt.

Solution:

zypper <span>install</span> librecode-devel

In general, when configuring, if you encounter something that is not available, open Yast and search for it. If it exists, install it, and then recompile to see what else is needed. If you can’t find it in Yast, then search online on Google .

Compile and install PHP7

<span>make</span> && <span>make</span> <span>install</span>
<p>其中,make之后可以选择make test。只是一个可选步骤,不执行不知道有什么问题,不过笔者暂时还没遇到。</p>

View the PHP7 directory after successful installation

After successful compilation and installation, check the PHP7 installation directory `ls /usr/local/php7`:

Set up PHP7 configuration file

<span>cp</span> /usr/local/src/php7/php.ini-production /usr/local/php7/etc/<span>php.ini
</span><span>cp</span> /usr/local/src/sapi/fpm/init.d.php-fpm /etc/init.d/php-<span>fpm
</span><span>cp</span> /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-<span>fpm.conf
</span><span>cp</span> /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf

Set environment variables

Add

to the last line of the /etc/profile file
export PATH=/usr/local/php7/bin:/usr/local/php7/sbin:$PATH


Then execute source /etc/profile

Set the PHP log directory and php-fpm process file (php-fpm.sock) directory

<span>mkdir</span> -p /var/log/php-fpm/ && <span>mkdir</span> -p /var/run/php-fpm && cd /var/run/ && <span>chown</span> -R nginx:nginx php-fpm

Set PHP to start at boot

<span>chmod</span> +x /etc/init.d/php-<span>fpm
chkconfig php</span>-fpm on
<p>可以用chkconfig命令查看开机启动服务列表。</p>

Start PHP service

service php-fpm start

Check whether PHP is started successfully through ps aux | grep 'php'

At this point, PHP7 has been installed successfully, and you can start using PHP7!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1083559.htmlTechArticle[Install PHP] How to compile and install PHP7 under openSUSE42.1, opensuse42.1php7 First recommend an article PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog. Inside...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
win11安装语言包错误0x800f0950什么原因win11安装语言包错误0x800f0950什么原因Jul 01, 2023 pm 11:29 PM

win11安装语言包错误0x800f0950什么原因?当我们在给windows11系统安装新语言包时,有时会遇到系统提示错误代码:0x800f0950,导致语言包安装流程无法继续进行下去。导致这个错误代码一般是什么原因,又要怎么解决呢?今天小编就来给大家说明一下win11安装语言包错误0x800f0950的具体解决步骤,有需要的用户们赶紧来看一下吧。win11电脑错误代码0x800f0950解决技巧1、首先按下快捷键“Win+R”打开运行,然后输入:Regedit打开注册表。2、在搜索框中输入“

如何在 Google Docs 中安装自定义字体如何在 Google Docs 中安装自定义字体Apr 26, 2023 pm 01:40 PM

GoogleDocs在学校和工作环境中变得很流行,因为它提供了文字处理器所期望的所有功能。使用Google文档,您可以创建文档、简历和项目提案,还可以与世界各地的其他用户同时工作。您可能会注意到GoogleDocs不包括MicrosoftWord附带的所有功能,但它提供了自定义文档的能力。使用正确的字体可以改变文档的外观并使其具有吸引力。GoogleDocs提供了大量字体,您可以根据自己的喜好从中选择任何人。如果您希望将自定义字体添加到Google文档,请继续阅读本文。在本文中

适用于 Windows 11 的记事本++:如何下载和安装它适用于 Windows 11 的记事本++:如何下载和安装它Jul 06, 2023 pm 10:41 PM

Notepad++主要由开发人员用于编辑源代码,由临时用户用于编辑文本。但是,如果您刚刚升级到Windows11,则在您的系统上下载和安装该应用程序可能具有挑战性。因此,我们将讨论在Windows11上下载和安装记事本++。此外,您可以轻松阅读我们关于修复Notepad++在Windows上没有响应的详细指南。记事本++可以在Windows11上运行吗?是的,记事本++可以在Windows11上有效工作,而不会出现兼容性问题。更具体地说,没有臃肿的选项或错误,只需在一个非常小的编辑器中即可。此外

Steam 未检测到 Windows 11/10 中已安装的游戏,如何修复Steam 未检测到 Windows 11/10 中已安装的游戏,如何修复Jun 27, 2023 pm 11:47 PM

Steam客户端无法识别您计算机上的任何游戏吗?当您从计算机上卸载Steam客户端时,会发生这种情况。但是,当您重新安装Steam应用程序时,它会自动识别已安装文件夹中的游戏。但是,别担心。不,您不必重新下载计算机上的所有游戏。有一些基本和一些高级解决方案可用。修复1–尝试在同一位置安装游戏这是解决这个问题的最简单方法。只需打开Steam应用程序并尝试在同一位置安装游戏即可。步骤1–在您的系统上打开Steam客户端。步骤2–直接进入“库”以查找您拥有的所有游戏。第3步–选择游戏。它将列在“未分类

修复:在 Xbox 应用上的 Halo Infinite(Campaign)安装错误代码 0X80070032、0X80070424 或 0X80070005修复:在 Xbox 应用上的 Halo Infinite(Campaign)安装错误代码 0X80070032、0X80070424 或 0X80070005May 21, 2023 am 11:41 AM

&lt;p&gt;&lt;strong&gt;HaloInfinite(Campaign)&lt;/strong&gt;是一款第一人称射击视频游戏,于2021年11月推出,可供单人和多用户使用。该游戏是Halo系列的延续,适用于Windows、XboxOne和Xbox系列的用户X|S。最近,它还在PC版XboxGamePass上发布,以提高其可访问性。大量玩家报告在尝试使用WindowsPC上的&lt;strong&gt;Xbox应

Windows 11 Lite:它是什么以及如何在您的 PC 上安装它Windows 11 Lite:它是什么以及如何在您的 PC 上安装它Apr 14, 2023 pm 11:19 PM

我们深知MicrosoftWindows11是一个功能齐全且设计吸引人的操作系统。但是,用户一直要求Windows11Lite版本。尽管它提供了重大改进,但Windows11是一个资源匮乏的操作系统,它可能很快就会使旧机器混乱到无法顺利运行的地步。本文将解决您最常问的关于是否有Windows11Lite版本以及是否可以安全下载的问题。跟着!有Windows11Lite版本吗?我们正在谈论的Windows11Lite21H2版本是由Neelkalpa的T

虚拟机如何安装Win11虚拟机如何安装Win11Jul 03, 2023 pm 12:17 PM

  虚拟机怎么安装Win11?近期有用户想要尝试使用VirtualBox虚拟机安装Win11,但是不太清楚具体的操作方法,针对这一情况,小编将为大家演示使用VirtualBox安装Win11的方法,很多小伙伴不知道怎么详细操作,小编下面整理了使用VirtualBox安装Win11的步骤,如果你感兴趣的话,跟着小编一起往下看看吧!  使用VirtualBox安装Win11的步骤  1、要下载VirtualBox,请前往VirtualBox官方下载页面,下载适用于Windows的.exe文件。如果你

如何在 Windows 11 中重新安装邮件应用程序如何在 Windows 11 中重新安装邮件应用程序Apr 14, 2023 pm 03:19 PM

&lt;p&gt;&lt;strong&gt;邮件应用程序&lt;/strong&gt;是Windows11内置的一个非常有用的电子邮件客户端。它允许您从一个位置管理所有邮件帐户。虽然Mail应用程序非常有用,但有时可能需要重置,有时也需要重新安装,原因有多种。在本文中,我们将通过一些简单的步骤说明如何从Windows11轻松卸载Mail应用程序,以及如何轻松地从MicrosoftStore将其取回。&lt;/p&gt;&l

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function