How to install and run phpize

511,820

Solution 1

For recent versions of Debian/Ubuntu (Debian 9+ or Ubuntu 16.04+) install the php-dev dependency package, which will automatically install the correct version of php{x}-dev for your distribution:

sudo apt install php-dev

Older versions of Debian/Ubuntu:

For PHP 5, 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

RHEL/CentOS/yum

yum install php-devel # see comments

Solution 2

For PHP7 Users

7.1

sudo apt install php7.1-dev

7.2

sudo apt install php7.2-dev

7.3

sudo apt install php7.3-dev

7.4

sudo apt install php7.4-dev

If not sure about your PHP version, simply run command php -v

Solution 3

Ohk.. I got it running by typing /usr/bin/phpize instead of only phpize.

Solution 4

Under Redhat Enterprise / CentOS, use yum to install the php-devel module:

yum install php-devel

For PHP 7, you need:

yum install php70-php-devel

Solution 5

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.

Share:
511,820

Related videos on Youtube

Hrishikesh Choudhari
Author by

Hrishikesh Choudhari

JavaScript and data visualization guy.

Updated on April 05, 2022

Comments

  • Hrishikesh Choudhari
    Hrishikesh Choudhari about 2 years

    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 didn't return anything.

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

  • Berry Langerak
    Berry Langerak over 12 years
    In which case /usr/bin is not in your PATH, but I'm guessing it should be. Do PATH=$PATH\:/usr/bin; export PATH, and phpize will work in the future.
  • Anand Phadke
    Anand Phadke about 11 years
    I am new to ubuntu... when i type this command it asks me are u root ..how to get permission to root ?
  • Nanne
    Nanne about 11 years
    prepend 'sudo' to the command, to get sudo apt-get install php5-dev
  • cheepychappy
    cheepychappy almost 11 years
    if using yum instead of apt-get, the appropriate package is called php-devel
  • andrej
    andrej over 10 years
    yum install php-devel on rhel/centos
  • Chintan Gor
    Chintan Gor almost 10 years
    I got this error message "ffmpeg shared libraries not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option" I am using this command "phpize" it is working but whene I am running this "./configure && make" this error comes
  • mac
    mac over 9 years
    After installing php5-dev, Also check the directory in which you are running this command. It should contain .m4 file
  • d.raev
    d.raev almost 9 years
    You may have to run sudo apt-get update && sudo apt-get upgrade to update your repositories
  • Daniel W.
    Daniel W. almost 9 years
    How can this be the solution? In the question he said, he already installed php5-dev.
  • Rahil Wazir
    Rahil Wazir over 8 years
    For PHP7, you can use php7.0-dev
  • YakovL
    YakovL almost 8 years
    please wrap your code bits with backticks so that it is displayed as code
  • Kevin Remisoski
    Kevin Remisoski almost 8 years
    you don't really need to type apt-get anymore. apt install is the same. apt-cache no longer needs to be typed anymore either just apt search
  • The Onin
    The Onin over 7 years
    For PHP7.1, use php7.1-dev
  • jim smith
    jim smith over 7 years
    For PHP 5.6 use php5.6-dev
  • Solomon Closson
    Solomon Closson almost 7 years
    php7.0-dev is not found in the package list for me. Weird, I see php5-dev in the list, but no php7.0 packages at all.
  • M_R_K
    M_R_K almost 7 years
    @SolomonClosson It depends on the OS version you use.
  • Phantom Watson
    Phantom Watson almost 7 years
    This results in No package php-devel available for me.
  • MacroMan
    MacroMan over 6 years
    Actually, using just php-dev will install the version currently released and maintained for your distro. So on Ubuntu 12 it will install php5-dev.
  • Stefan
    Stefan over 6 years
    For PHP7, I needed to use php70-php-devel
  • Metagrapher
    Metagrapher about 6 years
    sudo apt-get install php7*-dev will grab the version installed with your system. Make sure to update the major version (when that changes eventually)
  • Josh Whitlow
    Josh Whitlow about 6 years
    On my installation which uses cpanel, I had the php-devel package installed, but needed to use the full path name to execute phpize: /opt/cpanel/ea-php71/root/usr/bin/phpize, Reference: cpanel forums
  • MacroMan
    MacroMan over 5 years
    If you install package php-dev instead, PHP will always upgrade to the latest stable release. If you install php7.0-dev and PHP 7.1 is released, you generally won't be upgraded to it.
  • josef
    josef over 5 years
    yum install php72-php-devel for PHP 7.2
  • josef
    josef over 5 years
    and use this ln -s /opt/remi/php72/root/bin/phpize /usr/bin/phpize
  • eselskas
    eselskas over 5 years
    For PHP[Y] use php[y]-dev
  • 7ochem
    7ochem about 4 years
    Could you update your answer and add the solution for PHP 8? Now that PHP8 alpha 1 is here...
  • Saeesh Tendulkar
    Saeesh Tendulkar almost 4 years
    For PHP7.2, use php7.2-dev
  • be3
    be3 over 3 years
    No match for argument: php74-php-devel
  • Andy Bajka
    Andy Bajka about 3 years
    This worked for me: /opt/cpanel/ea-php80/root/usr/bin/phpize
  • lycanthrope10100
    lycanthrope10100 about 3 years
    Or you could do this scl enable php70 bash
  • Gwyneth Llewelyn
    Gwyneth Llewelyn over 2 years
    Two things on this old answer... 1) You should also include the instructions on how to install brew in the first place (get Command Line utilities, go to brew.sh and get it, beware of destroying your Apple-installed PHP, etc.); also note that Linux users can use brew, too! 2) pecl will obviously only install PECL packages, the OP was interested in ffmpeg-php, which is not available via PECL at all...