Recently when installing OCI8 on CentOS 7 (Linux) as a shared extension using PECL, after issuing the command “pecl install oci8” I got the error:
fatal error: oci8_dtrace_gen.h: No such file or directory
I was baffled as to what this error means. Basically what is going on is that the Remi PHP repositories are setup for dynamic tracing. If you follow instructions in the Underground PHP Oracle Manual, it describes “Installing OCI8 on Linux as a Shared Extension Using PECL”, which is where you will get this error.
To workaround the DTrace issue, you should first issue this command to enable DTRACE:
Then to proceed with the OCI8 install issue the command:
pecl install oci8
When prompted with (presumes Oracle Instant Client is installed):
Please provide the path to the ORACLE_HOME directory...
Then enter in this prompt “instantclient,<path to instant client lib folder>”. In my case I entered “instantclient,/usr/lib/oracle/12.2/client64/lib”.
After this the make should proceed, and then you just need to edit your “/etc/php.ini” file to add “extension=oci8.so” at the very bottom of the file and then restart your httpd service.