how to install and run phpize

2019-01-07 04:54发布

I have been meaning to install ffmpeg as an extension to my php setup. So before I can install it, I need to phpize it. I installed php5-dev by sudo apt-get install php5-dev But now when I run phpize I get the following error :

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

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 didnt return anything.

Any pointers here how I can get phpize and thus, ffmpeg up and running ?

15条回答
smile是对你的礼貌
2楼-- · 2019-01-07 05:33

On Debian/Ubuntu, it's in the php5-dev package.

sudo apt-get install php5-dev

For PHP 7.x (from rahilwazir comment):

sudo apt-get install php7.x-dev
查看更多
不美不萌又怎样
3楼-- · 2019-01-07 05:35

This might help someone on ubuntu. No promises.

sudo apt-get install libcurl3 php5-dev libcurl4-gnutls-dev libmagic-dev
sudo apt-get install php-http make
sudo pecl install pecl_http

And adding "extension=http.so" to php.ini (Normally located at /etc/php5/apache2/php.ini)

Then restart Apache (sudo service apache2 restart).

If in doubt, check your apache logs:

sudo su --
cd /var/log/apache2
tail -25 error.log

Is http.so starting or failing?

查看更多
萌系小妹纸
4楼-- · 2019-01-07 05:36

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.

查看更多
我命由我不由天
5楼-- · 2019-01-07 05:36

Install from linux terminal

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
查看更多
一夜七次
6楼-- · 2019-01-07 05:39

I had this exact problem on macOS in 2018.

For me, first running brew install php before sudo pecl install mongodb did the trick.

查看更多
淡お忘
7楼-- · 2019-01-07 05:41

In Ubuntu 16.04, you can install phpize with the command

aptitude install php7.1-dev // for php 7.1

which is equivalent to

apt-get install php7.1-dev // for php 7.1
查看更多
登录 后发表回答