This article is the author's previous record, although Mac OS X 10.9 version, but should also be perfectly successful in 10.10 on
Recent queries the library to do the conversion php, write Oracle last time because there is no intermediate layer oci8 modules and oracle instance, the hand-write code without debugging, the workload of some huge, so take some time to install the module oci8 convenient debugging php.
php by dynamically loading dynamic link library to use various php extension. Whether or mysql gd graphics library, it is in the form of dynamic link libraries released. I first baidu a bit, Mac users who want to use oracle's plenty of money, but most programs are given recompile php. Many people do not even have Mac comes with apache2 and php, directly to compile apache and php, I personally do not agree to do so. Since he has given you done php and apache, then this is probably the most will not go wrong. So I will not use, ready to select the compiled .so form to load.
But look more than an hour, so compiled module almost no articles, even if there are also articles compiled by macport, brew and other third-party software packages, and other downloads zlib library files to compile, personal spiritual cleanliness issue, this not in the way selection list.
Since the Internet is no, then I'll take a look official documentation php and the oracle. But the oracle there wrote a very long-winded, but still have to install oracle11g, php there'd find an article on the dynamic link library module compiled stuff.
There are three methods
Recompile the entire php,. / Configure --with-oci8 = shared
In the form of dynamic link library
As static link library
La miles winded to say a bunch, in fact, specifically compiled oci8.so then loaded in php.ini.
Search on google for a moment there is such a foreign site actually has an article about the compilation oci8
OCI8 relies on OS X having several client libraries and tools from
Oracle installed on OS X. For most intents and purposes download the
64-bit version of the following files under the title "Version
10.2.0.4 (64-bit) ":
In fact, it is to download Oracle official instantclient, according to the basic file and dylib sdk header files to compile, as the second sqlplus is an afterthought, to connect oracle database independent, I certainly Official Download 10g impossible to download the client directly downloaded 11g of instantclient.
Below Open a terminal, copy the necessary files to the system directory.
sudo cp instantclient_11_2 / sdk / include / *. h / usr / include (the / usr / include folder is a command-line tool to install Xcode after some)
sudo cp instantclient_11_2 / sqlplus / usr / bin (In fact, this is the installation of sqlplus client, in fact, does not get to be a)
sudo cp instantclient_11_2 / *. dylib / usr / lib
sudo cp instantclient_11_2 / *. dylib. * / usr / lib (which is actually copied lib DLL)
# The following to / usr / lib directory to be a symbolic link
sudo ln -s libclntsh.dylib.10.1 libclntsh.dylib
Next download compiler oci8, in fact, this can be used to automate pecl complete. But you have Xcode installed autoconf and command-line tools, autoconf I was directly compiled and installed, the Baidu search on the line, Xcode command line tools I had installed was upgraded when the results of 10.8-10.9 kill, so only and then install it again, I was later compiler error, view the information and found that the lack of header files, then wondered, are placed in / usr / include how the missing, the original command-line tools include folder was blown away. Only then reinstall it.
With pecl very automated
sudo pecl install oci8
Please provide the path to the ORACLE_HOME directory.
Use'instantclient, / path / to / instant / client / lib '
if you're compiling with Oracle Instant Client [autodetect]:
This is to provide you with dynamic link library catalog instantclient meaning
Direct input instantclient, / usr / lib and then translated well oci8.so
If there is no pecl, then manually download the source code oci8:
Unzip the zip file into the directory
./configure --with-oci8 = shared, instantclient, / usr / lib to see where we all understand, in fact, and pecl like to provide you with the lib file directory location
Then open /etc/php.ini in paragraphs extension plus extension = oci8.so on the line, restart apache using phpinfo function can see oci8 been successfully loaded.