Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax
  • Table Of Contents Toc
PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax

PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax

By : Yuli Vasiliev
4.8 (4)
close
close
PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax

PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax

4.8 (4)
By: Yuli Vasiliev

Overview of this book

Oracle Database gets high marks for performance, reliability, and scalability. Building and deploying your PHP applications on Oracle Database enables you to combine the power and robustness of Oracle and the ease of use, short development time, and high performance of PHP. When used in a complementary way, PHP and Oracle allow you to build high-performance, scalable, and reliable data-driven Web applications with a minimum of effort.When building a PHP/Oracle application, you have two general options. The first is to use an Oracle database just to store data, performing all the operations on that data on the client side; the other is to use the database not only to store data, but also to process it, thus moving data processing to the data. While building the key business logic of a database-driven PHP application inside the database is always a good idea, you should bear in mind that not all of the databases available today allow you to do. The Oracle database, which offers record-breaking performance, scalability, and reliability, does. The partnership of Oracle and the open-source scripting language PHP is an excellent solution for building high-performance, scalable, and reliable data-driven web applications.This 100% practical book is crammed full of easy-to-follow examples. It provides all the tools a PHP/Oracle developer needs to take advantage of the winning combination. It addresses the needs of a wide spectrum of PHP/Oracle developers, placing the emphasis on the most up-to-date topics, such as new PHP and Oracle Database features, stored procedure programming, handling transactions, security, caching, web services, and Ajax.
Table of Contents (16 chapters)
close
close
PHP Oracle Web Development
Credits
About the Author
About the Reviewer
Preface

Installing PHP


The current recommended releases of PHP are available for download from the downloads page of the php.net site at:

http://www.php.net/downloads.php

From this page, you can download the latest stable release of PHP 5 and then follow the steps below to install PHP in your system. For further assistance along the way, you may consult the Installation and Configuration manual available on the php.net web site at: http://www.php.net/manual/install.php. Alternatively, you might read the install.txt file that is shipped with PHP.

Installing PHP on Windows

Here are the basic installation steps for PHP 5 on Windows:

  • Extract the distribution file into the c:\php directory.

  • Add the C:\php directory to the PATH to make php5ts.dll available to the web server modules.

  • Rename php.ini-recommended to php.ini.

  • In php.ini, set the doc_root to your htdocs directory of Apache. For example:

doc_root = c:\Program Files\Apache Group\Apache2\htdocs
  • In the Apache httpd.conf configuration file, to install PHP as an Apache module, insert the following two lines:

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
  • In the Apache httpd.conf configuration file, configure the path to php.ini:

PHPIniDir "C:/php"
  • Restart Apache.

As an alternative to the above manual installation, you might use the Windows PHP installer that is also available from the downloads page of the php.net website.

Note

Although the Windows PHP installer is the fastest way to make PHP work, it doesn't allow you to set every option as you might want to. So, using the installer isn't the recommended method for installing PHP.

Once you have PHP installed on your Windows system, you might want to set some extensions for added functionality. It is important to note that many extensions are built into the Windows version of PHP. To use these extensions, you just uncomment them in the php.ini configuration file—no additional DLLs are required. However, some of the extensions require extra DLLs to work. For example, the PHP OCI8 extension needs the Oracle Client libraries.

Installing PHP on Unix-Like Systems

Here are basic installation steps for PHP 5 on Unix-like systems:

  • Extract the distribution file:

# gunzip php-5xx.tar.gz
# tar -xvf php-5xx.tar
  • Change dir to the directory containing the PHP sources:

# cd php-5xx
  • Configure your PHP installation:

# ./configure --with-apxs2=/usr/local/apache2/bin/apxs

Note

You cannot configure PHP to support the PHP OCI8 extension until you install the Oracle Client libraries required to run OCI applications (unless you have PHP and Oracle installed on the same computer). You'll need to recompile PHP for OCI8 support once you have these libraries installed. See the Oracle Instant Client section for details.

  • Compile and then install PHP:

# make
# make install
  • Set up php.ini.

# cp php.ini-dist /usr/local/lib/php.ini
  • Edit the httpd.conf Apache configuration file to load the PHP module into Apache:

LoadModule php5_module modules/libphp5.so
  • In httpd.conf, add handlers for files with the .php and .phps extensions:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
  • Restart Apache:

# usr/local/apache2/bin/apachectl start

By now you should have a working Apache/PHP web server.

Testing PHP

Once you have finished the installation steps, you might want to test PHP. The easiest way to make sure that PHP works properly is by using the following simple PHP script:

<?php
phpinfo();
?>

Save this script as phptest.php in the htdocs directory of Apache and then run it in your browser by opening the following URL:

http://yourservername/phptest.php

Provided your Apache/PHP web server is up and running, the phptest.php script should output a large amount of information about the current state of PHP. Graphically it might look like the following figure.

As expected, the phpinfo output doesn't contain an OCI8 section—we have installed PHP without OCI8 support. The next section discusses how to add the OCI8 support to an existing installation of PHP.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon