Quantcast
Viewing all articles
Browse latest Browse all 12

Switching between PHP 5.1.x and Zend Core for Oracle

This situation arises as I had installed Zend Core for Oracle (ZCO), and I wanted to try out some PDO functions. As ZCO comes with PHP 5.0.5, I was stuck, and PDO is only included from PHP 5.1.x onwards, I had to install PHP 5.1.x on my Windows box so that I can play with PDO. The assumption is that we have ZCO installed and working with a Apache2 server. I share the steps here on how to install another version of PHP so that it will co-exist peacefully with ZCO. On my box, I have Oracle XE installed.

1. Have Apache2 and ZCO already installed.
2. Download PHP 5.1.x, I downloaded PHP 5.1.4's Windows binaries.
3. Untar it into D:\php\php-5.1.4 or a directory of your choice.
4. Rename php.ini-recommended to php.ini
5. Edit httpd.conf, open it up and look for the block of configuration settings which refers to ZCO:

LoadModule php5_module "D:/Zend/Core For Oracle/bin/php5apache2.dll"
PHPIniDir "D:/Zend/Core For Oracle/etc"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps

AllowOverride none
Order deny,allow
Allow from all

Alias /ZendCore "D:/Zend/Core For Oracle/GUI"

6. Add small block in at the beginning and end like so:

"<ifdefine phpZend>
LoadModule php5_module "D:/Zend/Core For Oracle/bin/php5apache2.dll"
PHPIniDir "D:/Zend/Core For Oracle/etc"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps

AllowOverride none
Order deny,allow
Allow from all

Alias /ZendCore "D:/Zend/Core For Oracle/GUI"
</ifdefine>"

7. If you are using Zend Framework libraries, remember to set the include path, that should be set inside php.ini.

; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
include_path = ".;D:\Projects\CDC PHP\ZendFrameworkSVN\library;D:\Projects\CDC

PHP\ZendFrameworkSVN\incubator\library"

8. Now add the block of configuration for your PHP5 installation.

<ifdefine php-5.1.4>
LoadModule php5_module "D:/php/php-5.1.4/php5apache2.dll"
# configure the path to php.ini
PHPIniDir "D:/php/php-5.1.4"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
</ifdefine>

9. Install the Apache services for your new PHP5 installation:
apache.exe -k install -n Apache_php-5.1.4 -D php-5.1.4
10. That's it, we have 2 services installed now. The original ZCO and PHP5. At any one time, only one can be started.

Viewing all articles
Browse latest Browse all 12

Trending Articles