<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Testing</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="oci8.installation.html">Installation</a></div> <div class="next" style="text-align: right; float: right;"><a href="oci8.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="oci8.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="oci8.test" class="section"> <h2 class="title">Testing</h2> <div class="section" id="oci8.testing"> <p class="para"> The OCI8 test suite is in <var class="filename">ext/oci8/tests</var>. After OCI8 tests are run this directory will also contain logs of any failures. </p> </div> <div class="section"> <p class="para"> Before running PHP's tests, edit <var class="filename">details.inc</var> and set $user, $password and the $dbase connection string. The OCI8 test suite has been developed using the <em>SYSTEM</em> account. Some tests will fail if the test user does not have equivalent permissions. </p> <p class="para"> If Oracle Database Resident Connection Pooling is being tested, set $test_drcp to <strong><code>TRUE</code></strong> and ensure the connection string uses an appropriate DRCP pooled server. </p> <p class="para"> An alternative to editing <var class="filename">details.inc</var> is the set environment variables, for example: <div class="example-contents"> <div class="cdata"><pre> $ export PHP_OCI8_TEST_USER=system $ export PHP_OCI8_TEST_PASS=oracle $ export PHP_OCI8_TEST_DB=localhost/XE $ export PHP_OCI8_TEST_DRCP=FALSE </pre></div> </div> Note in some shells these variables are not propagated correctly to the PHP process and tests will fail to connect if this method is used. </p> <p class="para"> Next, set any necessary environment for the Oracle database. With Oracle 10<em class="emphasis">g</em>R2 XE do: <div class="example-contents"> <div class="cdata"><pre> $ . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh </pre></div> </div> </p> <p class="para"> With Oracle 11<em class="emphasis">g</em>R2 XE do: <div class="example-contents"> <div class="cdata"><pre> $ . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh </pre></div> </div> </p> <p class="para"> For other versions of the Oracle database do: <div class="example-contents"> <div class="cdata"><pre> $ . /usr/local/bin/oraenv </pre></div> </div> </p> <p class="para"> Some shells require that <var class="filename">php.ini</var> has <em>E</em> in the variables_order parameter, for example: <div class="example-contents"> <div class="cdata"><pre> variables_order = "EGPCS" </pre></div> </div> </p> <p class="para"> Run all the PHP tests with: <div class="example-contents"> <div class="cdata"><pre> $ cd your_php_src_directory $ make test </pre></div> </div> or run only the OCI8 tests with <div class="example-contents"> <div class="cdata"><pre> $ cd your_php_src_directory $ make test TESTS=ext/oci8 </pre></div> </div> </p> <p class="para"> When the tests have completed, review any test failures. On slow systems, some tests may take longer than the default test timeout in <var class="filename">run-tests.php</var>. To correct this, set the environment variable <em>TEST_TIMEOUT</em> to a larger number of seconds. </p> <p class="para"> On fast machines with a local database configured for light load (e.g. Oracle 11<em class="emphasis">g</em>R2 XE) some tests might fail with ORA-12516 or ORA-12520 errors. To prevent this, increase the database <em>PROCESSES</em> parameter using the following steps: </p> <p class="para"> Connect as the oracle software owner: <div class="example-contents"> <div class="cdata"><pre> $ su - oracle </pre></div> </div> </p> <p class="para"> Set the necessary Oracle environment with <var class="filename">oracle_env.sh</var> or <var class="filename">oraenv</var>, as described above. </p> <p class="para"> Start the SQL*Plus command line tool and increase <em>PROCESSES</em> <div class="example-contents"> <div class="cdata"><pre> $ sqlplus / as sysdba SQL> alter system set processes=100 scope=spfile </pre></div> </div> </p> <p class="para"> Restart the database: <div class="example-contents"> <div class="cdata"><pre> SQL> startup force </pre></div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="oci8.installation.html">Installation</a></div> <div class="next" style="text-align: right; float: right;"><a href="oci8.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="oci8.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>