Search code examples
phpoci8phpize

php-devel package required but is already installed


I am running PHP 7.2 and am trying to install oci8

pecl install oci8 results in a download but it fails when running phpize with the following message:

running: phpize
Can't find PHP headers in /opt/remi/php72/root/usr/include/php
The php-devel package is required for use of this command.
ERROR: `phpize' failed

Howver, if I try to install php-devel I get a message that it is already installed:

Package php-devel-5.4.45-17.el7.remi.x86_64 already installed and latest version
Nothing to do

I have tried several options but cannot get phpize to work. Any help appreciated.

Thanks

UPDATE

  • I did a fresh install of php 7.3 using remi. This installed the php.ini file into the /etc directory
  • I installed php73-php-oci8
  • I confirmed the php version and module in phpinfo()

With regards Oracle Instant Client, I am not entirely sure what I am doing so here is what I did:

  • cd /etc/yum.repos.d
  • (a few steps to get packages)
  • sudo yum install oracle-instantclient18.3-basic
  • sudo yum install oracle-instantclient18.3-devel
  • sudo yum install oracle-instantclient18.3-jdbc
  • sudo yum install oracle-instantclient18.3-sqlplus
  • sudo yum list oracle-instantclient* ... this confirms the installs

This is as far as I can get. I am not sure how to "include it in the library path". I am not clear on the next step. Please advise

Thank you


Solution

  • As you are using the php72 SCL, you need the php72-php-devel package.

    But, why do you want to build from sources, when nearly all extensions are available ?

    yum install php72-php-oci8
    

    Notice: this package requires the oracle client v18.3 installed, and in the library path.

    P.S. indeed, the error message probably need to be fixed.