Tuesday, May 16, 2006

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.

8 comments:

Yaron Bielous said...

Kianhui,

The upcoming version of Zend Core for Oracle (version 1.4) will be based on PHP 5.1.4 and the PDO extension will become a part of the Zend Core for Oracle distribution.
We expect the new version to become available within the next month or two.

Regards,

Yaron Bielous
Zend

Yaron Bielous said...

The upcoming version of ZCO (version 1.4) will be based on PHP 5.1.4 and will include the PDO extension.
The release is currently schedule towards the end of June.

Yaron Bielous said...

The upcoming ZCO version (1.4) will be based on PHP 5.1.4 and will include the PDO extension.
The release is currently plan for the end of June.

Thank you for your interest with ZCO.

ddumping said...

This site is one of the best I have ever seen, wish I had one like this.
»

Anonymous said...

Hello!

Nice site, keep up the good work .

http://buy-phentermine.hem.nu BUY PHENTERMINE
BUY PHENTERMINE
http://blog.sol.no/buy-phentermine
BUY PHENTERMINE
http://buy-phentermine.hem.nu buy phentermine
http://buy-phentermine.hem.nu phentermine online
http://buy-phentermine.hem.nu order phentermine
http://buy-phentermine.hem.nu cheap phentermine
http://buy-phentermine.hem.nu buy phentermine online
http://buy-phentermine.hem.nu phentermine diet pill
http://buy-phentermine.hem.nu phentermine online pharmacy
http://buy-phentermine.hem.nu phentermine prescription
http://buy-phentermine.hem.nu what is phentermine
http://buy-phentermine.hem.nu free phentermine

Anonymous said...

Great site, I am bookmarking it!Keep it up!
With the best regards!
David

Grantus Maximus said...

An excellent piece! Found it useful for me now using the present release of Zend Core which now includes PDO. HOWEVER doesn't include PDO_MSSQL! So I'm going to have to do the same thing now as a work around...

Kianhui said...

Thanks Grantus, perhaps Microsoft needs to start bucking up their effort to work more closely with the PHP community and Zend.