Many folks who need web hosting these days want the simplest method for managing servers. To many, it is expected that graphical-user-interfaces (GUIs) are provided. This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO. See also MySQL.
Five ways to create include path for PHP One thing that people often complain about PHP is that there are always more than one way to do the same thing in PHP.
- A framework and distribution system for reusable PHP components.
- VodaHost offers the best cpanel hosting on super fast servers with unlimited Bandwidth.
Installing PHP and the Oracle Instant Client for Linux and Windows. What You See Is What You Get Element.
Installing PHP and the Oracle Instant Client for Linux and Windows. For PHP 5. 5, OCI8 2. Oracle Database 1. Release 1. By Christopher Jones. March 2. 01. 5 See the version for PHP 5. Oracle Database 1. Release 2. The easiest way to configure PHP to access a remote Oracle Database is to use the free Oracle Instant Client libraries.
This note describes how to install PHP's OCI8 extension and Oracle Instant Client on Linux and Windows. The Underground PHP and Oracle Manual explains other installation options and contains more detail.
PHP OCI8 is the PHP extension for connecting PHP to Oracle Database. OCI8 is open source and included with PHP. The name is derived from Oracle's C . PHP OCI8 links with Oracle C client libraries, which are included in the Oracle Database software and also in Oracle Instant Client. To use Instant Client an existing database is needed because Instant Client does not include one.
If the database is local then Instant Client, although convenient and still usable, is generally not needed because PHP OCI8 can be built using the database libraries. When using Instant Client 1. PHP OCI8 connects to all editions of Oracle 1.
Earlier versions of Oracle Instant Client can be used for connecting to older databases. The latest and greatest Oracle functionality is only available when PHP OCI8 2. Oracle Instant Client 1. Oracle Database 1. On Linux, PHP is often manually compiled because the packaged version is generally not up to date.
However, if you don't wish to compile code there are some options: PHP 5. PHP OCI8 packages for Oracle Linux are available from oss. It comes in free and supported versions for Linux and Windows, and includes OCI8 and Instant Client. All of these solutions simplify the installation process for PHP. However, if you want more control, the remainder of this article shows a way to manually install and use PHP with Oracle Database. Software Requirements: Software. Notes Oracle Instant Client.
Download the . On Linux, also download the . If space is at a premium, the Basic Lite package can be used instead of Basic. Apache HTTP Server.
Version 2. 4. PHPVersion 5. PECL OCI8. Version 2.
PHP 5. 5. Enabling the PHP OCI8 Extension on Linux. The following steps show how to build PHP and OCI8 from source code. Install Apache. Install the Apache HTTP Server and development packages, for example with. Install PHPDownload the PHP 5. Install PHP following Installation on Unix systems in the PHP manual. For example. # tar - jxf php- 5. Either the ZIP files or RPMs can be used.
Install the RPMs as the root user, for example. Uvh oracle- instantclient. PECL OCI8 2. 0 has more features than the OCI8 1. PHP 5. 5's source bundle. It will compile with PHP 5. The latest production extension can be automatically downloaded and added to PHP using. If you have the Instant Client ZIP files, or want a specific version of Instant Client used, then explicitly give the appropriate path after .
You might also want to set standard Oracle environment variables such as TNS. If NLS. Setting environment variables in PHP scripts can lead to obvious or non- obvious problems. On Oracle Linux, export environment variables in /etc/sysconfig/httpd, for example. Review the Read. Me. txt file. Unzip modules- 2. VC1. 1. zip and copy mod.
Review mod. Accept the . Because Windows PHP is 3. Instant Client is needed. Unzip Instant Client and rename the directory to c: \instantclient. The php. Only one of these DLLs can be enabled. Configure PHPCopy c: \php- 5. Win. 32- VC1. 1- x.
Win. 32- VC1. 1- x. Edit php. ini: Add a timezone line like. America/Los. The browser page will contain an . This example lists all tables owned by the user HR. This can be done in SQL*Plus by connecting as the SYSTEM user and executing the statement. SQL> ALTER USER hr IDENTIFIED BY welcome ACCOUNT UNLOCK; The third oci. No tnsnames. ora or other Oracle Network file is needed.
See Oracle's Understanding the Easy Connect Naming Method documentation for the Easy Connect syntax. Troubleshooting. Check the Apache error log file for start- up errors. Temporarily add error. For security reasons, switch display. Chapter 1. 0 contains information about commonly seen connection errors. Oracle's SQL*Plus command line tool can be downloaded from the Instant Client page to help resolve environment and connection problems.
Check SQL*Plus can connect and then ensure the Environment section (not the Apache Environment section) of phpinfo. Windows Specific Help. If the phpinfo. php script does not produce an . Ensure the correct Windows redistributable client is installed. Make sure all installed software is 3. Linux Specific Help. If using Instant Client ZIP files, make sure the two packages are unzipped to the same location.
Make sure a symbolic link libclntsh. Don't use the Instant Client RPMs on Debian machines.
Set all required Oracle environment variables in the shell that starts Apache. Conclusion. Using Oracle Instant Client and installing PHP OCI8 from PECL provides maximum PHP flexibility, allowing components to be easily installed and upgraded. Questions and suggestions can be posted on the OTN PHP or Instant Client forums. The PHP Developer Center contains links to useful background material.
The PHP Extension Community Library. What is PECL? PECL. PHP Extensions, providing a directory of all known.