Installing the Oracle Library for PHP

Chris Sibert wrote a good tutorial on installing the Oracle library for PHP. If you’re running SELinux, I’d recommend temporarily turning it off to get the module setup so you don’t have to worry about problems during the install, and then turn SELinux back on after you verify the module is working. Then you can update SELinux’s policy to allow Apache and PHP to do everything they need to do.

After you’ve got the module working working you can just put the database server’s hostname and port in the db parameter of oci_connect(), rather than messing with a tnsnames.ora file.

oci_connect('username', 'password', '127.0.0.1:1521/dbname');

Update: The Underground PHP and Oracle Manual has a lot of information on installation, and also a good section on tuning. oci_pconnect() can be used to create a persistent connection to the database server, rather than creating a new one during each script instance.

Leave a Reply

Your email address will not be published. Required fields are marked *