Using New Oracle Tutorial on NetBeans, Zend Framework, and Oracle Database
By Jeffrey Rubinoff on Jan 19, 2011
Christopher Jones has a new tutorial up called Developing a PHP Web Application With Oracle Database 11g. This tutorial uses NetBeans IDE 6.9.1 and Zend Framework. It's a lab and assumes you are using Linux and have access to Oracle 11.2.
However, I have got this lab to work on Windows using OracleXE (free download!) and XAMPP. I also tested it with a nightly dev build of NetBeans IDE. I thought I'd share with you the differences between what I did and what the lab says to do.
In the Prerequisites section,
- I had already installed Oracle XE and did not install Oracle 11.2.
- I did not create a user named PHPHOL. Because the tutorial uses the default HR sample schema, I used the HR user credentials instead (user hr, password hr).
- I did not set the application environment in the Apache httd.conf file. I guess you could, though. I ended up adding the server properties to both development and production environments instead, in application.ini (see below).
- Because I was using XAMPP, I did not install a new Apache server or PHP engine. I did not enable the Apache UserDir module. I did not set the oci8.connection_class property. All I did was go into XAMPP's php.ini file and uncomment the line for the oci8 extension. (Actually, I had done that much earlier, when I had been using XAMPP with oci8.)
- I did use my own download of Zend Framework 1.10.2 instead of the version that is included in XAMPP. This is because the zf.php in XAMPP appears to be buggy, or at least I have never been able to register it with NetBeans IDE.
In the section Creating the Application Framework,
- My sources folder was different. My setup was different, so I did not have a root phphol directory, and Apache was using htdocs instead of public_html. My path then was C:/XAMPP/htdocs/PHPLab instead of /home/phphol/public_html/PHPLab.
- I did not add a RewriteBase line to .htaccess. I tried this and my project would not run correctly. It worked fine without it.
In the section Listing Employees,
- I added a different set of database server properties to application.ini, because I was using OracleXE and because I was accessing the HR schema directly as user hr. So instead of
resources.db.adapter = "Oracle" resources.db.params.dbname = "localhost/orcl" resources.db.params.username = "phphol" resources.db.params.password = "welcome"I added
resources.db.adapter = "Oracle" resources.db.params.dbname = "localhost/XE" resources.db.params.username = "hr" resources.db.params.password = "hr"
- Because I had not set the application environment in httpd.conf or in index.php, I added the database server properties to both production and development sections of application.ini instead of only the development : production section.
- There are some references to the linux cp command. That's just the copy command, so I copied the files in Total Commander instead.
Except for these changes, the tutorial worked fine for me.