Linux + Apache + Php + Oracle Basic Environment Construction

Source: Internet
Author: User

Linux + Apache + Php + Oracle Basic Environment Construction
1. install Apache by compiling and installing packages. Download Pcre, Apr, Apr-Util from various official websites. 2. Compile and install Apache :. /configure -- prefix =/usr/local/apache -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util --- pcre =/usr/local/pcre -- with-mpm = prefork -- enable-cache -- enable-disk-cache -- enable-mem-cache -- enable-file-cache -- enable-nonportable -atormics -- enable-mods-shared = most -- enable-so 3. package to be installed for PHP installation (1) YUM installation, 163 source yum install libxml2-devel curl-devel libpng-devel freetype-devel libjpeg-devel-y (2) Build method installation, download the Libiconv and libmcrypt (3) RPM installation methods from various software official websites, download the oracle-instantclient11.2-basicoracle-instantclient11.2-develoracle-instantclient11.2-sqlplus from the ORACLE official website 4, the environment variable to be updated export ORACLE_HOME =/usr/lib/oracle/11.2/client64 # connection ORACLE session location export LD_LIBRARY_PATH = $ ORACLE_HOME/lib # LIB location export NLS_LANG = AMERICAN_AMERICA.AL32UTF8 # Show non-garbled characters in Chinese. 5. Add the host name 127.0.0.1 BJ-NQ-V-xxx in/etc/hosts. 6. Compile and install PHP. /configure -- prefix =/usr/local/php -- with-config-file-path =/usr/local/php/etc -- with-apxs2 =/usr/local/apache/bin/ apxs -- with-freetype-dir -- with-jpeg-dir -- with-png-dir -- with-zlib -- with-libxml-dir =/usr -- enable-xml -- disable-rpath -- enable-discard-path -- enable-safe-mode -- enable-bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- with-curlwrappers -- enable -mbregex -- enable-force-cgi-redirect -- enable-mbstring -- with-mcrypt -- with-gd -- enable-gd-native-ttf -- enable-sockets -- with-gettext -- with-oci8 = instantclient -- with-pdo-oci -- with-iconv =/usr/local/libiconv -- enable-opcache = no 7. Test PHP connection to ORACLE code

# The test code is reproduced in: region = "localhost"; # oracle ip address $ db_user = "atyu30"; # ORACLE username $ db_pass = "atyu30 "; # ORACLE password $ db_sid = "atyu30"; # oracle sid $ dbconn = OCILogon ($ db_user, $ db_pass, "(DEscriptION = (ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521) (CONNECT_DATA = (SID = $ db_sid) "); if ($ dbconn! = False) {echo "Connect"; echo "DB server :". $ db_server; echo "User :". $ db_user; echo "Password :". $ db_pass; echo "SID :". $ db_sid; echo "Success \ n"; if (OCILogOff ($ dbconn) = true) {echo "the connection is closed successfully! ";}} Else {echo" connection failed ";}?>

 


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.