Skip to content

Instantly share code, notes, and snippets.

@fabianofa
Created March 6, 2017 10:55
Show Gist options
  • Save fabianofa/98b989c739a5290b8d8f8d64ee781211 to your computer and use it in GitHub Desktop.
Save fabianofa/98b989c739a5290b8d8f8d64ee781211 to your computer and use it in GitHub Desktop.
Instalando extensão em ambiente linux com php já compilado
If you already have php installed (from repository for example), you can compile only the PDO_OCI from PHP source (you need the instantclient installed)
Download the PHP source with same version that you have installed;
Unzip;
Change to directory php-YOUR-VERSION/ext/pdo_oci
Inside the pdo_oci folder, run these commands:
$ git clone https://github.com/php/php-src.git
$ cd php-src
#opcional se na versão mais recente do PHP:
$ git checkout PHP-7.0.15
$ cd ext/pdo_oci
$ phpize
$ ./configure --with-pdo-oci=instantclient,/usr,12.1
$ make && make install
$ echo "extension=pdo_oci.so" > /etc/php.d/pdo_oci.ini
$ service httpd restart
This method will only create a pdo_oci.so in the PHP extensions folder, don't need to recompile entire PHP. You can do it with repositories versions of PHP, and can do it with any extension inside the ext folder in PHP source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment