Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect, using php, if the machine has oracle (oci8 and/or pdo_oci) installed?

Tags:

php

oracle

How can I detect, using php, if the machine has oracle (oci8 and/or pdo_oci) installed?

I'm working on a PHP project where some developers, such as myself, have it installed, but there's little need for the themers to have it. How can I write a quick function to use in the code so that my themers are able to work on the look of the site without having it crash on them?

like image 772
John Fiala Avatar asked Sep 21 '08 17:09

John Fiala


1 Answers

if the oci extension isn't installed, then you'll get a fatal error with farside.myopenid.com's answer, you can use function_exists('oci_connect') or extension_loaded('oci8') (or whatever the extension's actually called)

like image 164
Greg Avatar answered Oct 11 '22 02:10

Greg