Functionality is right now identical to that of the MySQL plugin, with no additional Oracle specific functionality. All hard coded queries and functions have only been changed to be OCI8 comaptible. For further details, enhanced functions, behavior and examples, see the MySQL plugin.
Command line interface
- $ oracle [-u username] [--user=username] [-ppassword] [--password=password] [-h hostname] [--host=hostname]
- username – (string, optional) Username to connect with.
- password – (string, optional) Password to connect with.
- hostname – (string, optional) host to connect to, e.g. localhost/XE.
- Implement SQLPlus style variables with oci_bind for multiple commands on a single line, like MySQL supports SET @var
- Rename EXEC and EXECUTE statements to CALL
- Implement rewrite for DESC or DESCRIBE statements
Connect to Oracle via PHP and Apache
On Oracle Linux make sure that the system are set up to make a connection between PHP and Oracle. For error handling check Apache errorlog.
- Install PEAR for PHP
- Copy absolute path to ORACLE_HOME to clipboard.
# su oracle $ set | grep ORACLE_HOME $ exit
- PECL is included in; now run
pecl install oci8
- Paste ORACLE_HOME when prompted
- Append extension=oci8.so to /etc/php.ini (check the correct location with phpinfo();
# php -r "phpinfo();" | grep -ni php\.ini
- The file /etc/sysconfig/httpd should contain the following lines (make sure in the following that this actually is your ORACLE_HOME dir)
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME TNS_ADMIN=$ORACLE_BASE/product/11.2.0/dbhome_1/network/admin; export TNS_ADMIN PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
- Restart Apache
# apachectl -k graceful