8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux
Zend Core for Oracle v2
Using Zend Core for Oracle, one installation can provide you with a working PHP installation with full Oracle connectivity and an optional Apache server, with no need for extra configuration needed. It doesn't get simpler than that.
Download the appropriate Zend Core software for your platform, then follow the installation instructions below to perform a default installation on Linux or Windows XP.
Zend Core Installation on Linux
This Zend Core installation was performed on a clean installation of Oracle Enterprise Linux 4.5.
Log in as the root users and open a terminal session. Unzip and extract the Zend Core software, then start the installation.
gunzip ZendCoreForOracle-v2.0.1-Linux-x86.tar.gz tar -xvf ZendCoreForOracle-v2.0.1-Linux-x86.tar cd ZendCoreForOracle-v2.0.1-Linux-x86 ./install
Click the "OK" button on the welcome screen.
Click the "Next" button at the start of the license agreement screen.
Accept the license agreement by clicking the "Yes" button.
Accept the default location by clicking the "OK" button.
Wait for the Zend Core installation to complete.
Enter a password for the Zend Core Web GUI, then click the "OK" button.
Re-enter the password and click the "OK" button on the confirmation screen.
Click the "No" button on the support screen.
Click the "Yes" button to install the bundled Apache server.
Wait for the Apache installation to complete.
Accept port "80" by clicking the "OK" button.
Read the SSL support note, then click the "OK" button.
Accept the default installation method by clicking the "OK" button.
Read the Apache installation note, then click the "OK" button.
Accept the "Oracle OCI DB Drivers" option by clicking the "OK" button.
Click the "Next" button on the installation summary screen.
Click the "OK" button on the installation completion screen.
Zend Core Installation on Windows
Unzip the "ZendCoreForOracle-v2.0.3-Windows-x86.zip" zip file, double-click the resulting "ZendCoreForOracle-v2.0.3-Windows-x86.exe" executable, then wait for the install shield to start.
Click the "Next" button on the welcome screen.
Accept the license agreement, then click the "Next" button.
Select the "Complete" setup type, then click the "Next" button.
Accept the default location by clicking the "Next" button.
Select the "Install bundled Apache 2.2.2" option, then click the "Next" button.
Accept port "80" by clicking the "Next" button.
Accept the default extension associations by clicking the "Next" button.
Enter an administration password, then click the "Next" button.
Select the "No" support option, then click the "Next" button.
Click the "Install" button on the the read to install screen.
Wait for the installation to complete.
Towards the end of the installation the "Update Your System" wizard is initiated.
Click the "OK" button on the message dialog.
Click the "Finish" button on the installation complete screen.
Test It
Copy the example PHP code from the Web Scripting for Oracle article and save it into a file called "test.php" in one of the following locations.
- Linux: "/usr/local/Zend/apache2/htdocs"
- Windows: "C:\Program Files\Zend\Apache2\htdocs\"
You will need to adjust the database connection details on line 10. When using the Zend Core, you have three ways to identify the database you wish to connect to, all of which are shown below.
// Connect to the SCOTT schema of the DB10G database. // EZConnect. $conn=OCILogon("scott", "tiger", "//myserver.mydomain:1521/DB10G.WORLD"); // Full service description. $conn=OCILogon("scott", "tiger", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = myserver.mydomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DB10G.WORLD) ) )"); // tnsnames.ora putenv("TNS_ADMIN=/usr/local/Zend/Core/network/admin"); //Linux //putenv("TNS_ADMIN=C:\Program Files\Zend\Core For Oracle\network\admin"); // Windows $conn=OCILogon("scott", "tiger", "DB10G");
The first method uses the EZConnect URL to identify the database. The second method, uses a full description, as you would expect to see in the tnsnames.ora file. The third method uses a database alias, which is translated using a tnsnames.ora file. For the third method to work correctly, you must create a tnsnames.ora file in the location specified by the "putenv" function. To match the example code on Linux we must create the directory.
mkdir -p /usr/local/Zend/Core/network/admin/
Then create a "tnsnames.ora" with the following contents.
DB10G = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = myserver.mydomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DB10G.WORLD) ) )
The third connection method should work correctly now also.
Run the test script by requesting the following style URL from a browser.
http://myserver.mydomain/test.php
The expect output is displayed in the Web Scripting For Oracle article.
During the installation you were prompted for an administrator password. The following URL points you to the administration login page.
http://myserver.mydomain/ZendCore
Enter the password you specified during the installation, the click the triple-arrow image.
You are then presented with the Zend Core Administration page.
For more information see:
Hope this helps. Regards Tim...