特殊:Badtitle/NS100:PHPOracle
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/PHPOracle }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/af | • {{#if: UbuntuHelp:PHPOracle|Afrikaans| [[::PHPOracle/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ar | • {{#if: UbuntuHelp:PHPOracle|العربية| [[::PHPOracle/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/az | • {{#if: UbuntuHelp:PHPOracle|azərbaycanca| [[::PHPOracle/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/bcc | • {{#if: UbuntuHelp:PHPOracle|جهلسری بلوچی| [[::PHPOracle/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/bg | • {{#if: UbuntuHelp:PHPOracle|български| [[::PHPOracle/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/br | • {{#if: UbuntuHelp:PHPOracle|brezhoneg| [[::PHPOracle/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ca | • {{#if: UbuntuHelp:PHPOracle|català| [[::PHPOracle/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/cs | • {{#if: UbuntuHelp:PHPOracle|čeština| [[::PHPOracle/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/de | • {{#if: UbuntuHelp:PHPOracle|Deutsch| [[::PHPOracle/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/el | • {{#if: UbuntuHelp:PHPOracle|Ελληνικά| [[::PHPOracle/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/es | • {{#if: UbuntuHelp:PHPOracle|español| [[::PHPOracle/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/fa | • {{#if: UbuntuHelp:PHPOracle|فارسی| [[::PHPOracle/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/fi | • {{#if: UbuntuHelp:PHPOracle|suomi| [[::PHPOracle/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/fr | • {{#if: UbuntuHelp:PHPOracle|français| [[::PHPOracle/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/gu | • {{#if: UbuntuHelp:PHPOracle|ગુજરાતી| [[::PHPOracle/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/he | • {{#if: UbuntuHelp:PHPOracle|עברית| [[::PHPOracle/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/hu | • {{#if: UbuntuHelp:PHPOracle|magyar| [[::PHPOracle/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/id | • {{#if: UbuntuHelp:PHPOracle|Bahasa Indonesia| [[::PHPOracle/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/it | • {{#if: UbuntuHelp:PHPOracle|italiano| [[::PHPOracle/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ja | • {{#if: UbuntuHelp:PHPOracle|日本語| [[::PHPOracle/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ko | • {{#if: UbuntuHelp:PHPOracle|한국어| [[::PHPOracle/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ksh | • {{#if: UbuntuHelp:PHPOracle|Ripoarisch| [[::PHPOracle/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/mr | • {{#if: UbuntuHelp:PHPOracle|मराठी| [[::PHPOracle/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ms | • {{#if: UbuntuHelp:PHPOracle|Bahasa Melayu| [[::PHPOracle/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/nl | • {{#if: UbuntuHelp:PHPOracle|Nederlands| [[::PHPOracle/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/no | • {{#if: UbuntuHelp:PHPOracle|norsk| [[::PHPOracle/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/oc | • {{#if: UbuntuHelp:PHPOracle|occitan| [[::PHPOracle/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/pl | • {{#if: UbuntuHelp:PHPOracle|polski| [[::PHPOracle/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/pt | • {{#if: UbuntuHelp:PHPOracle|português| [[::PHPOracle/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ro | • {{#if: UbuntuHelp:PHPOracle|română| [[::PHPOracle/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/ru | • {{#if: UbuntuHelp:PHPOracle|русский| [[::PHPOracle/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/si | • {{#if: UbuntuHelp:PHPOracle|සිංහල| [[::PHPOracle/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/sq | • {{#if: UbuntuHelp:PHPOracle|shqip| [[::PHPOracle/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/sr | • {{#if: UbuntuHelp:PHPOracle|српски / srpski| [[::PHPOracle/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/sv | • {{#if: UbuntuHelp:PHPOracle|svenska| [[::PHPOracle/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/th | • {{#if: UbuntuHelp:PHPOracle|ไทย| [[::PHPOracle/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/tr | • {{#if: UbuntuHelp:PHPOracle|Türkçe| [[::PHPOracle/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/vi | • {{#if: UbuntuHelp:PHPOracle|Tiếng Việt| [[::PHPOracle/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/yue | • {{#if: UbuntuHelp:PHPOracle|粵語| [[::PHPOracle/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/zh | • {{#if: UbuntuHelp:PHPOracle|中文| [[::PHPOracle/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/zh-hans | • {{#if: UbuntuHelp:PHPOracle|中文(简体)| [[::PHPOracle/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PHPOracle | UbuntuHelp:PHPOracle | {{#if: | :}}PHPOracle}}/zh-hant | • {{#if: UbuntuHelp:PHPOracle|中文(繁體)| [[::PHPOracle/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:PHPOracle|:PHPOracle|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :PHPOracle/zh | | {{#ifexist: PHPOracle/zh | | {{#ifeq: {{#titleparts:PHPOracle|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:PHPOracle|1|-1|}} | zh | | }}
To be able to access Oracle databases from PHP, you will need to have the Oracle OCI library installed in your machine.
There are two ways to get this library:
- Install the Oracle Database [Oracle10g] [Oracle9i]
- Install Oracle Instant Client
If your Oracle database is in another machine, the Oracle Instant Client is a smaller install.
PHP using Oracle Database Server
TODO
PHP using Oracle Instant Client
Tested Environment:
Ubuntu Server 6.06 LTS Oracle Instant Client 10.2.0.2
Prerequisites:
sudo apt-get install build-essential sudo apt-get install php5-dev php-pear
Also download the Oracle Instant Client http://www.oracle.com/technology/tech/oci/instantclient/index.html
You will need the Basic (34MB) and SDK (600K). The Basic Lite version does not work.
cd /usr/local/lib sudo unzip <location-of-instant-client-basic> sudo unzip <location-of-instant-client-sdk> cd instantclient_10_2 sudo ln -s libclntsh.so.10.1 libclntsh.so
The symbolic link is needed by during the compilation step later.
sudo pecl install oci8
You will be prompted for the location of the library:
instantclient,/usr/local/lib/oracle_10_2
If successful, you may now add the following line at the bottom of php.ini
extension = oci8.so
The php.ini is found in 2 places: /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini
sudo /etc/init.d/apache2 reload
Check <?php echo phpinfo() ?> to verify if the OCI8 module is available.