Skip Headers
Oracle® Database Express Edition 2 Day Plus PHP Developer Guide
10g Release 2 (10.2)

Part Number B25317-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

2 Getting Started

This chapter explains how to install and test your Oracle Database Express Edition (Oracle Database XE) and PHP environment. It has the following topics:

What You Need

To install your Oracle Database XE and PHP environment, you need:

Installing Oracle Database Express Edition

Oracle Database Express Edition is available from the Oracle Technology Network at

http://www.oracle.com/technology/xe

Install Oracle Database XE following the instructions in Oracle Database Express Edition Installation Guide for Linux or Oracle Database Express Edition Installation Guide for Microsoft Windows.

See Also:

Testing the Oracle Database XE Installation

Perform the following steps to test that you can connect to Oracle Database XE.

  1. To test that Oracle Database XE is accessible, connect to the database using the Oracle Database XE home page:

  2. In a browser, enter the URL for your Oracle Database Express Edition home page:

    http://localhost:8080/htmldb
    
    
  3. In the Oracle Database XE Login page, enter hr in the Username and Password fields. Click Login:

    Description of chap2_test_install_000.gif follows
    Description of the illustration chap2_test_install_000.gif

    The Oracle Database XE Home page appears:

    Description of chap2_test_install_011.gif follows
    Description of the illustration chap2_test_install_011.gif

    If the message, Invalid Login Credentials appears, you may need to unlock the HR user. See Unlocking the HR User following.

  4. Click the Logout link to terminate the HTMLDB session.

    Description of chap2_test_install_010.gif follows
    Description of the illustration chap2_test_install_010.gif

  5. The Logout Confirmation page appears:

    Description of chap2_test_install_012.gif follows
    Description of the illustration chap2_test_install_012.gif

Unlocking the HR User

The PHP application connects to the database as the HR user. You may need to unlock the HR account as a user with DBA privileges. To unlock the HR user:

  1. In a browser, enter the URL for your Oracle Database Express Edition home page:

    http://localhost:8080/htmldb
    
    
  2. At the login screen, in the Username field enter system, and in the Password field enter manager (or the password you entered at the prompt during configuration of Oracle Database XE). Click Login.

    Description of chap2_test_install_005.gif follows
    Description of the illustration chap2_test_install_005.gif

  3. In the Home page, click the arrow on the Administration icon, move the mouse over Database Users, and click Manage Users:

    Description of chap2_test_install_006.gif follows
    Description of the illustration chap2_test_install_006.gif

  4. In the Manage Users page, click the HR user icon:

    Description of chap2_test_install_007.gif follows
    Description of the illustration chap2_test_install_007.gif

  5. In the Manage Database User page, select Unlocked from the Account Status list and then click the Alter User button. The message User Altered appears below the navigation breadcrumb toward the top of the page.

  6. Click the Logout link to terminate the HTMLDB session.

    Description of chap2_test_install_009.gif follows
    Description of the illustration chap2_test_install_009.gif

For further information about unlocking an Oracle Database account, see Chapter 6, "Managing Users and Security," in the Oracle Database Express Edition 2 Day DBA guide.

Installing Apache

You can download Apache for Windows or Linux from:

http://httpd.apache.org/

Apache is normally a standard part of a Linux environment.

Install Apache following the instructions available from the same site.

Testing the Apache Installation on Windows

To test the Apache Web server installation:

  1. Start your Web browser on the host on which you installed Apache.

  2. Enter the following URL:

    http://localhost/
    
    

    Your browser should display a page similar to the following:

    Description of chap2_test_install_013.gif follows
    Description of the illustration chap2_test_install_013.gif

    If this page does not appear check your Apache configuration. Common problems are that Apache is not running, or that it is listening on a non-default port.

Testing the Apache Installation on Linux

To test the Apache Web server installation:

  1. Start your Web browser on the host you installed Apache on, and enter the following URL:

    http://localhost/
    
    

    Your browser should display a page similar to the following:

    Description of chap2_install_001.gif follows
    Description of the illustration chap2_install_001.gif

    If this page does not appear check your Apache configuration. Common problems are that Apache is not running, or that it is listening on a non-default port.

  2. In the default Apache Web server configuration file, set up a public virtual directory as public_html for accessing your PHP files. Use your preferred editor to open the Apache configuration file /etc/httpd/conf/httpd.conf (the directory may be different in your installation of Linux) and remove the "#" character at the start of the following line:

    #UserDir public_html
    
    

    This enables the browser to make an HTTP request using a registered user on the system and to serve files from the $HOME/public_html directory of the user. For example:

    http://localhost/~user/
    
    

    In this example, your Apache httpd.conf file should contain the following lines:

    <IfModule mod_userdir.c>
        #
        # UserDir is disabled by default since it can confirm the presence
        # of a username on the system (depending on home directory
        # permissions).
        #
        #UserDir disable
    
        #
        # To enable requests to /~user/ to serve the user's public_html
        # directory, remove the "UserDir disable" line above, and uncomment
        # the following line instead:
        #
        UserDir public_html
    </IfModule>
    
    
  3. In a command window, to use the new Apache configuration file, restart Apache by entering the following commands:

    su -
    Password: <enter your su (root) password>
    apachectl restart
    
    
    Description of chap2_install_002.gif follows
    Description of the illustration chap2_install_002.gif

    If the Apache Web server does not start, check the error log files to determine the cause. It may be a configuration error.

  4. In the command window, log in as a normal (not root) user and create a public_html subdirectory in the $HOME directory with the following command:

    mkdir $HOME/public_html
    
    
    Description of chap2_install_003.gif follows
    Description of the illustration chap2_install_003.gif

Installing Zend Core for Oracle

To obtain Zend Core for Oracle for Windows or Linux:

  1. Enter the following URL in your Web browser

    http://www.oracle.com/technology/tech/php/zendcore/index.html
    
    
  2. To the right of the "Zend Core for Oracle" Web page, click the Free Download button:

    Description of chap2_install_004.gif follows
    Description of the illustration chap2_install_004.gif

  3. Save the downloaded file in a temporary directory, such as c:\tmp on Windows, or \tmp on Linux.

Installing Zend Core for Oracle on Windows

This section describes how to install Zend Core for Oracle on Windows.

This tutorial is specific to PHP in Zend Core for Oracle.

For detailed setup information for Zend Core for Oracle, see the Installation Guide under Product Information on the Zend Core for Oracle Web page at

http://www.oracle.com/technology/tech/php/zendcore/index.html

This procedure assumes you downloaded the Zend Core for Oracle software to c:\tmp. If not, in step 1 you must cd to the directory containing the downloaded software, and not to c:\tmp.

The file name and extraction directory are based on the current version. Throughout this procedure, ensure you use the directory name for the version you are installing.

You must be the administrator user to install Zend Core for Oracle. To install Zend Core for Oracle, perform the following steps:

  1. In Windows Explorer, navigate to the directory where you downloaded the Zend Core for Oracle software.

  2. To start the Zend Core for Oracle installation process, double click the .exe file.

    Review the README and installation documentation distributed with Zend Core for Oracle.

    Use the tab or arrow keys, or use your mouse to navigate between input fields and buttons in the Zend installer. Press Enter or click with the mouse to select a button.

  3. In the initial Zend Core for Oracle Installation page, click Next.

    Description of chap2_install_030.gif follows
    Description of the illustration chap2_install_030.gif

    Copyright, 2005, Zend Technologies Ltd.

  4. In the Zend Core for Oracle License Agreement page, read the license agreement. To continue with the installation, select I accept the terms of the license agreement and then click Next.

    Description of chap2_install_031.gif follows
    Description of the illustration chap2_install_031.gif

    Copyright, 2005, Zend Technologies Ltd.

  5. You are prompted to select the type of installation you want. Select Complete and then click Next.

    Description of chap2_install_032.gif follows
    Description of the illustration chap2_install_032.gif

    Copyright, 2005, Zend Technologies Ltd.

  6. When prompted to specify the location for installing Zend Core for Oracle, accept the default (or enter your preferred location), and click Next.

    Description of chap2_install_033.gif follows
    Description of the illustration chap2_install_033.gif

    Copyright, 2005, Zend Technologies Ltd.

  7. The next page prompts you to select the Web server for Zend Core installation. Accept the Apache installation and click Next.

    Description of chap2_install_034.gif follows
    Description of the illustration chap2_install_034.gif

    Copyright, 2005, Zend Technologies Ltd.

  8. You are then prompted to select the Web Server API to use. Select Apache Module and then click Next.

    Description of chap2_install_035.gif follows
    Description of the illustration chap2_install_035.gif

    Copyright, 2005, Zend Technologies Ltd.

  9. When prompted to select extensions to associate with your Zend Core for Oracle installation, select php and click Next.

    Description of chap2_install_036.gif follows
    Description of the illustration chap2_install_036.gif

    Copyright, 2005, Zend Technologies Ltd.

  10. You are now prompted to enter a Zend Core GUI password. This password enables you to log in to the Zend Core Console to configure directives or property values.

    Enter the password you want to use when accessing the Zend Core Console, and click Next.

    Description of chap2_install_037.gif follows
    Description of the illustration chap2_install_037.gif

    Copyright, 2005, Zend Technologies Ltd.

  11. You are prompted to reenter your Zend Core GUI password.

    Description of chap2_install_039.gif follows
    Description of the illustration chap2_install_039.gif

    Copyright, 2005, Zend Technologies Ltd.

  12. You may optionally enter your Zend network user ID and password to be able to use the Zend Core Console to track when updates to Zend Core and PHP components are available. If you have not registered, or do not want to track updates, select No and then click Next.

    Description of chap2_install_040.gif follows
    Description of the illustration chap2_install_040.gif

    Copyright, 2005, Zend Technologies Ltd.

  13. The installation wizard is now ready to begin installing Zend Core for Oracle on your computer. Click Install to start the installation wizard.

    Description of chap2_install_041.gif follows
    Description of the illustration chap2_install_041.gif

    Copyright, 2005, Zend Technologies Ltd.

  14. You are notified that the Apache configuration file has been modified, and where the original Apache configuration file has been stored. Click OK to continue.

    Description of chap2_install_042.gif follows
    Description of the illustration chap2_install_042.gif

    Copyright, 2005, Zend Technologies Ltd.

  15. When the installation completes, you are prompted to restart your computer. Select Yes, I want to restart my computer now and then click Finish.

    Description of chap2_install_043.gif follows
    Description of the illustration chap2_install_043.gif

    Copyright, 2005, Zend Technologies Ltd.

    The Zend Core for Oracle installation is now complete.

Installing Zend Core for Oracle on Linux

This section describes how to install Zend Core for Oracle on Linux.

This tutorial is specific to PHP in Zend Core for Oracle.

For detailed setup information for Zend Core for Oracle, see the Installation Guide under Product Information on the Zend Core for Oracle Web page at

http://www.oracle.com/technology/tech/php/zendcore/index.html

This procedure assumes you downloaded the Zend Core for Oracle software to /tmp. If not, in step 1 you must cd to the directory containing the downloaded software, and not to /tmp.

The file name and extraction directory are based on the current version. Throughout this procedure, ensure you use the directory name for the version you are installing.

You must be the root user to install Zend Core for Oracle. To install Zend Core for Oracle, perform the following steps:

  1. Enter the following commands in a command window to extract the contents of the downloaded Zend Core for Oracle software:

    su -
    Password: <enter the root password>
    cd /tmp
    tar -zxf ZendCoreForOracle-v1.2.1-Linux-x86.tar.gz
    
    
    Description of chap2_install_012.gif follows
    Description of the illustration chap2_install_012.gif

    By default, files are extracted to a subdirectory called ZendCoreForOracle-v1.2.1-Linux-x86.

    Review the README and installation documentation distributed with Zend Core for Oracle.

  2. To start the Zend Core for Oracle installation process, enter the following commands:

    cd ZendCoreForOracle-v1.2.1-Linux-x86
    ./install
    
    
    Description of chap2_install_013.gif follows
    Description of the illustration chap2_install_013.gif

    The install command must be executed with root user privileges. After you enter the ./install command, the installation process begins, as documented in subsequent steps.

    Use the tab or arrow keys, or use your mouse to navigate between input fields and buttons in the Zend installer. Press Enter or click with the mouse to select a button.

  3. In the initial Zend Core for Oracle Installation page, click OK.

    Description of chap2_install_014.gif follows
    Description of the illustration chap2_install_014.gif

    Copyright, 2005, Zend Technologies Ltd.

  4. In the Zend Core for Oracle V.1 page, read the license agreement. To continue with the installation, click Exit.

    Description of chap2_install_015.gif follows
    Description of the illustration chap2_install_015.gif

    Copyright, 2005, Zend Technologies Ltd.

  5. When prompted to accept the terms of the license, click Yes.

    Description of chap2_install_016.gif follows
    Description of the illustration chap2_install_016.gif

    Copyright, 2005, Zend Technologies Ltd.

  6. When prompted to specify the location for installing Zend Core for Oracle, accept the default (or enter your preferred location), and click OK.

    Description of chap2_install_017.gif follows
    Description of the illustration chap2_install_017.gif

    Copyright, 2005, Zend Technologies Ltd.

    The installer begins extracting the files required for the installation. The following progress screen is visible during the installation process:

    Description of chap2_install_018.gif follows
    Description of the illustration chap2_install_018.gif

    Copyright, 2005, Zend Technologies Ltd.

  7. When the progress window indicates that all the software has been installed, you are prompted to "Please enter the GUI password." In the Password field, enter the password you want to use when accessing the Zend Core Console, and click OK.

    Description of chap2_install_019.gif follows
    Description of the illustration chap2_install_019.gif

    Copyright, 2005, Zend Technologies Ltd.

    The password specified here allows you to log in to the Zend Core for Oracle administration Web pages to enable configuration of Zend Core for Oracle engine directives or property values.

  8. When prompted to "Verify the password," enter the same password as specified in Step 7 and click OK.

    Description of chap2_install_020.gif follows
    Description of the illustration chap2_install_020.gif

    Copyright, 2005, Zend Technologies Ltd.

  9. In the Zend Core support page, you may optionally enter your Zend network user ID and password to be able to use the Zend Core Console to track when updates to Zend Core and PHP components are available. If you have not registered, or do not want to track updates, click No.

    Description of chap2_install_021.gif follows
    Description of the illustration chap2_install_021.gif

    Copyright, 2005, Zend Technologies Ltd.

  10. The next page prompts you to select the Web server for Zend Core installation. Select the default Apache installed with Linux. Click OK.

    Description of chap2_install_022.gif follows
    Description of the illustration chap2_install_022.gif

    Copyright, 2005, Zend Technologies Ltd.

    If you choose, you can install Zend Core for Oracle with another supported Web server that is installed on your system.

  11. In the page confirming your Web server selection, at the "Do you wish to proceed?" prompt, click Yes.

    Description of chap2_install_023.gif follows
    Description of the illustration chap2_install_023.gif

    Copyright, 2005, Zend Technologies Ltd.

  12. In the next installation page, you are prompted to "Please select an installation method for Apache 2.0.52." Select Apache module as the method, and click OK.

    Description of chap2_install_024.gif follows
    Description of the illustration chap2_install_024.gif

    Copyright, 2005, Zend Technologies Ltd.

  13. In the next installation page, when you are prompted to "Please select a virtual server for the Zend Core GUI," select Main Server, and click OK.

    Description of chap2_install_025.gif follows
    Description of the illustration chap2_install_025.gif

    Copyright, 2005, Zend Technologies Ltd.

  14. In the next installation page, at the "Would you like to restart the Web Server" prompt, click Yes.

    Description of chap2_install_026.gif follows
    Description of the illustration chap2_install_026.gif

    Copyright, 2005, Zend Technologies Ltd.

  15. When prompted "Would you like to configure another Web Server to use Zend Core," click No.

    Description of chap2_install_027.gif follows
    Description of the illustration chap2_install_027.gif

    Copyright, 2005, Zend Technologies Ltd.

  16. The final installation page (containing "Thank you for installing Zend Core for Oracle") lists useful configuration commands and a Web page for the administration of the Zend Core engine. Take note of the information and click EXIT.

    Description of chap2_install_028.gif follows
    Description of the illustration chap2_install_028.gif

    Copyright, 2005, Zend Technologies Ltd.

  17. When the Zend Core installation pages are terminated, a message is displayed in your command window.

    Description of chap2_install_029.gif follows
    Description of the illustration chap2_install_029.gif

    Copyright, 2005, Zend Technologies Ltd.

    The Zend Core for Oracle installation is now complete.

Configuring Zend Core for Oracle

In this section, you configure environment variables and Zend Core directives that control default error reporting in Web pages.

  1. Enter the following URL in a Web browser to access the Zend Core Administration page:

    http://localhost/ZendCore/
    
    

    The Zend Core for Oracle Welcome page is displayed.

  2. Enter the GUI password that you provided during Zend Core for Oracle installation in the Password field. Click the login >>> icon.

    Description of chap2_config_003.gif follows
    Description of the illustration chap2_config_003.gif

    Copyright, 2005, Zend Technologies Ltd.

    The Control Center System Overview page is displayed.

  3. Click the Configuration tab to display the configuration options.

    Description of chap2_config_005.gif follows
    Description of the illustration chap2_config_005.gif

    Copyright, 2005, Zend Technologies Ltd.

  4. Click the + icon to expand the Error Handling and Logging configuration entry.

    Description of chap2_config_007.gif follows
    Description of the illustration chap2_config_007.gif

    Copyright, 2005, Zend Technologies Ltd.

  5. Set the display_errors directive to On to enable the display of errors in the HTML script output during development.

    Description of chap2_config_008.gif follows
    Description of the illustration chap2_config_008.gif

    Copyright, 2005, Zend Technologies Ltd.

    Because there are unsaved changes, the "Unsaved configuration" message appears under the page header.

  6. Click Save Settings to save the configuration change.

    Because you have made configuration changes, you must restart the Apache Web server. Under the page header notice the "Please Restart Apache" message reminding you to do so.

  7. Click Restart Server to restart the Apache server.

    The PHP Configuration page is refreshed after the Apache server restarts. Should the page not refresh after a short period of time, manually restart Apache and reload the PHP Configuration page.

  8. Click Logout to exit the Zend Core for Oracle Administration page.

    Now that you have completed the basic configuration changes, proceed to the next section to test the Zend Core for Oracle installation.

Testing the Zend Core for Oracle Installation

To test the Zend Core for Oracle installation:

  1. Create a subdirectory called chap2. To create a directory for your application files, and to change to the newly created directory, enter the following commands in a command window:

    On Windows:

    mkdir c:\program files\Apache Group\Apache2\htdocs\chap2
    cd c:\program files\Apache Group\Apache2\htdocs\chap2
    
    

    On Linux:

    mkdir $HOME/public_html/chap2
    cd $HOME/public_html/chap2
    
    

    If you create files in a different location, you must change the steps for file editing and execution to match your working directory name and URL.

    Description of chap2_test_install_002.gif follows
    Description of the illustration chap2_test_install_002.gif

  2. Create a file called hello.php that contains the following HTML text:

    <?php
      echo "Hello, world!";
    ?>
    
    
  3. Open a Web browser and enter the following URL in your browser:

    On Windows:

    http://localhost/chap2/hello.php
    
    

    On Linux:

    http://localhost/~<username>/chap2/hello.php
    
    

    The line "Hello, world!" appears in the browser.

    Description of chap2_hello_001.gif follows
    Description of the illustration chap2_hello_001.gif