Due to the recent system upgrade, you need to consider the support for Oracle on the system. php supports oracle, which is not as simple as mysql. We need to install several things. next we will talk about how to install oci on UbuntuServer12.04. an error has been reported before. now I have written the correct steps, which may not be applicable to anyone, but I can use them for reference. 1. download instantclient from the official oracle website. three files need to be downloaded.
Due to the recent system upgrade, you need to consider the support for Oracle on the system.
Php supports oracle, which is not as simple as mysql. We need to install several things.
Next, let's talk about how to install oci on Ubuntu Server 12.04. An error has been reported before. Now, I have written the correct steps, which may not be applicable to everyone, but I can learn from them.
1. Download instantclient from the official oracle website.
Three files need to be downloaded.
1.instantclient-basic-linux-11.2.0.3.0.zip
2.instantclient-sdk-linux-11.2.0.3.0.zip
3.instantclient-sqlplus-linux-11.2.0.3.0.zip
Then upload the three files to your server ..
Decompress the package one by one using the unzip command. decompress the package and place it all in the "instantclient_11_2" folder.
2. Then we need to add the following two environment variables to the system.
# The Directory for storing the extracted files
Export ORACLE_HOME =/root/instantclient_11_2
# I have not added this before, and an error will be reported later
Export ORACLE_BASE =/root/instantclient_11_2
3. After adding these two variables, We will install OCI8.
Before installation, We need to install two tools.
Sudo apt-get install php-pear sudo apt-get install php5-dev
After the installation is complete, we will start to install OCI.
Sudo pecl install oci8
During the installation process, the system will ask you about the instantclient location.
Instantclient,/root/instantclient_11_2
After entering the information, wait for the automatic installation to complete oci8.
Don't worry. The last step is to add OCI support for php.
Open the php. ini file and add
Extension = oci8.so
OK. Now the job is finished.