Summary of problems with installing and connecting to Oracle using PHP in Linux

Source: Internet
Author: User

[PHP]

Server Information: Linux + apache2 + Oracle
The following steps assume that Linux + apache2 + Oracle has been correctly installed, especially the environment variables of oracle.
[
Make sure that you have correctly set the Oracle environment variables for oracle users and web daemon users (that is, to get the Oracle environment variables of oracle users to the root user ). The environment variables to be set are listed below:
ORACLE_HOME # Oracle installation path
Oracle_sid # Oracle Database ID
LD_LIBRARY_PATH # LD connection LIBRARY PATH
Nls_lang # oralce region (language) settings
Ora_nls33 # ora_nls33 path
After setting environment variables for Web Server users, you also need to add the Web server users (nobody, WWW) to the Oracle group.
]

[PHP start: Install it as root as possible]
# Tar-xzpvf php-4.3.8.tar.gz [unzip PHP package]
# Cd php-4.3.8
#. /Configure -- prefix =/home/www/apache2/PHP -- with-apxs2 =/home/www/apache2/bin/apxs -- With-Oracle =/home/Oracle/ora9/product/ 9.2 -- with-oci8 =/home/Oracle/ora9/product/9.2 -- enable-sockets -- enable-track-vars -- enable-sigchild
Parameter adjustment according to actual conditions: [Prefix: install PHP to The apache2 Directory]
[With-apxs2: specified to The apache2 directory/bin/apxs]
[With-Oracle: ORACLE_HOME path]
[With-oci8: ORACLE_HOME path]
[Other three default]
[In this step, make sure that the path is correct and there is no error until Thank you .. PHP appears]
# Make [long wait...]
# Make install [later...]

# Vi **/apache2/CONF/httpd. conf
[
Check whether the file contains the following three lines: if not, add
Loadmodule php4_module modules/libphp4.so
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP-source. PHPs
]
# Cp PHP. ini-Dist/usr/local/lib/PHP. ini [check whether the configuration file (PHP. INI) path in phpinfo () is correct]
# Restart Apache
[PHP completed]

[
PHP connection to Oracle:
Because the Oracle directory needs to be read by Apache process users,
When using PHP to connect to Oracle, the following error occurs: Error while trying to retrieve text for error.
Set the Oracle directory to 755
# Chmod 755-r $ ORACLE_HOME

Encountered: "ORA-27121: Unable to determine size of shared memory segment" error
A ORA-01034: Oracle not available
ORA-27121: Unable to determine size of shared memory segment
Linux error: 13: Permission denied
The main reason is that the Oracle installer does not set the correct setuid for the oracle executable program. Set it as follows:
$ CD $ ORACLE_HOME/bin
$ Chmod 6751 Oracle
The result is similar.

$ LS-L $ ORACLE_HOME/bin/Oracle
-Rwsr-s -- X 1 Oracle oinstall 23352783 Aug 14 2001/home/Oracle/APP/Oracle/product/8.1.6/bin/Oracle
]
[
About the garbled characters of Chinese data stored in Oracle:
Make sure the character set settings are the same in the following three places:
1. Client application Character Set)
2. Client nls_lang parameter settings
Third, set the character set on the server.
]

[/PHP]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.