php 如何安装和运行phpize
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3108937/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install and run phpize
提问by Hrishikesh Choudhari
I have been meaning to install ffmpegas an extension to my PHP setup. So before I can install it, I need to phpizeit. I installed php5-devby sudo apt-get install php5-dev. But now when I run phpizeI get the following error :
我一直想将其安装ffmpeg为 PHP 设置的扩展。所以在我安装它之前,我需要phpize它。我安装php5-dev了sudo apt-get install php5-dev. 但是现在当我运行时phpize出现以下错误:
phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module
The location of my php.ini is /usr/local/zend/etc/php.ini
我的 php.ini 的位置是 /usr/local/zend/etc/php.ini
From another online resource I tried this
从另一个在线资源我试过这个
sudo apt-get install autoconf automake libtool m4
But all of them are already installed.
但是它们都已经安装好了。
Locate config.m4 didn't return anything.
定位 config.m4 没有返回任何东西。
Any pointers here how I can get phpizeand thus, ffmpegup and running?
这里有任何指示我如何获得phpize并因此ffmpeg启动并运行?
回答by Blackout
For recent versions of Debian/Ubuntu (Debian 9+ or Ubuntu 16.04+) install the php-devdependency package, which will automatically install the correct version of php{x}-devfor your distribution:
对于最新版本的 Debian/Ubuntu(Debian 9+ 或 Ubuntu 16.04+),安装php-dev依赖包,它会自动php{x}-dev为您的发行版安装正确的版本:
sudo apt install php-dev
Older versions of Debian/Ubuntu:
旧版本的 Debian/Ubuntu:
For PHP 5, it's in the php5-dev package.
对于 PHP 5,它位于 php5-dev 包中。
sudo apt-get install php5-dev
For PHP 7.x (from rahilwazir comment):
对于 PHP 7.x(来自 rahilwazir 评论):
sudo apt-get install php7.x-dev
RHEL/CentOS/yum
RHEL/CentOS/yum
yum install php-devel # see comments
回答by M_R_K
For PHP7 Users
对于 PHP7 用户
7.1
7.1
sudo apt install php7.1-dev
sudo apt 安装 php7.1-dev
7.2
7.2
sudo apt install php7.2-dev
sudo apt 安装 php7.2-dev
7.3
7.3
sudo apt install php7.3-dev
sudo apt 安装 php7.3-dev
7.4
7.4
sudo apt install php7.4-dev
sudo apt 安装 php7.4-dev
If not sure about your PHP version, simply run command php -v
如果不确定您的 PHP 版本,只需运行命令 php -v
回答by Hrishikesh Choudhari
Ohk.. I got it running by typing /usr/bin/phpizeinstead of only phpize.
哦 .. 我通过键入/usr/bin/phpize而不是仅键入来运行它phpize。
回答by fedorqui 'SO stop harming'
Under Redhat Enterprise / CentOS, use yumto install the php-develmodule:
在 Redhat Enterprise / CentOS 下,使用yum安装php-devel模块:
yum install php-devel
For PHP 7, you need:
对于 PHP 7,您需要:
yum install php70-php-devel
回答by Bosh
Hmm... actually i dont know how this solved it? But the following steps solved it for me:
嗯……其实我不知道这是怎么解决的?但以下步骤为我解决了这个问题:
find / -name 'config.m4'
Now look if the config.m4 is anywhere in a folder of that stuff you want to phpize. Go to that folder and run phpize directly in there.
现在看看 config.m4 是否在您想要 phpize 的文件夹中的任何位置。转到该文件夹并直接在其中运行 phpize。
回答by Manoj Selvin
Step - 1:If you are unsure about the php version installed, then first run the following command in terminal
步骤 - 1:如果您不确定安装的 php 版本,请先在终端中运行以下命令
php -v
Output:the above command will output the php version installed on your machine, mine is 7.2
输出:上面的命令会输出你机器上安装的php版本,我的是7.2
PHP 7.2.3-1ubuntu1 (cli) (built: Mar 14 2018 22:03:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.3-1ubuntu1, Copyright (c) 1999-2018, by Zend Technologies
Step 2:Then to install phpize run the following command, Since my php version is 7.2.3. i will replace it with 7.2, so the command will be,
第 2 步:然后安装 phpize 运行以下命令,因为我的 php 版本是 7.2.3。我将用 7.2 替换它,所以命令是,
sudo apt-get install php7.2-dev
Step 3:Done!
第 3 步:完成!
Alternate method(Optional):To automatically install the phpize version based on the php version installed on your machine run the following command.
替代方法(可选):要根据您机器上安装的 php 版本自动安装 phpize 版本,请运行以下命令。
sudo apt-get install php-dev
This command will automatically detect the appropriate version of php installed and will install the matching phpize for the same.
此命令将自动检测已安装的适当版本的 php,并将为其安装匹配的 phpize。
回答by num3ri
In Ubuntu 16.04, you can install phpizewith the command
在 Ubuntu 16.04 中,您可以phpize使用以下命令进行安装
aptitude install php7.1-dev // for php 7.1
which is equivalent to
这相当于
apt-get install php7.1-dev // for php 7.1
回答by pingle60
For ubuntu 14.04LTS with php 7, issue:
对于带有 php 7 的 ubuntu 14.04LTS,发出:
sudo apt-get install php-dev
Then install:
然后安装:
pecl install memcache
回答by Sumon Sarker
Install from
linuxterminal
从
linux终端安装
sudo apt-get install <php_version>-dev
Example :
例子 :
sudo apt-get install php5-dev #For `php` version 5
sudo apt-get install php7.0-dev #For `php` version 7.0
回答by HMagdy
Of course in PHP7.2
当然在 PHP7.2
sudo apt-get install php7.2-dev

