DevTech101

DevTech101

Note: The PHP plug we use on the intranet today taken from here and here, will not work with Informix-PDO
Because it was compiled with Thread Safety: Enabled and Informix-PDO compiles with Thread Safety: Disabled causing a mismatch

Sun Web Server PHP installation

Install PHP from the Sun Cool Stack (current version is 1.3.1) get it from here

This is a list depending packages needed.

CSKamp_1.3.1_sparc.pkg
CSKmysql_1.3.1_sparc.pkg
CSKruntime_1.3.1_sparc.pkg
CSKlibsbundle_1.3.1_sparc.pkg
CSKperl_1.3.1_sparc.pkg
CSKtomcatbundle_1.3.1_sparc.pkg

Add PHP support to your web server instance

cd /opt/coolstack/php5/
/opt/coolstack/php5/setup-ws7-php.sh

Usage:
This script will configure Coolstack PHP with Sun Java System Web Server 7
Here, you will need to provide the top level location of your Web Server 7
installation and your Web Server 7 instance_name name to which this script
should configure to run PHP scripts.

Enter your Web Server installation location(/sun/webserver7) : /opt/webserver7
Enter your Web Server instance name to configure with PHP(https-dev1): https-dev1


UPDATED: /opt/webserver7/https-dev1/config/magnus.conf
UPDATED: /opt/webserver7/https-dev1/config/obj.conf
UPDATED: /opt/webserver7/https-dev1/config/mime.types

Setup was sucessful.
[...]

/opt/coolstack/php5 # /opt/webserver7/bin/wadm --user=admin --host=dev1 --port=3335
Please enter admin-user-password>
[...]

pull-config --config=dev1 dev1

deploy-config dev1

Note: First pull the config using the commend line, then deploy and restart the web server instance

Oracle PHP-PDO installation

Download the libraries from Oracle available here
Download the list of packages below

  • Instant Client Package Basic: All files required to run OCI, OCCI, and JDBC-OCI applications
  • sqlplus package
  • sdk package

Extract all the packages in /usr/local/instantclient

packages list:
basic-11.1.0.6.0-solaris-sparc32.zip
sqlplus-11.1.0.6.0-solaris-sparc32.zip
sdk-11.1.0.6.0-solaris-sparc32.zip

cd /usr/local/instantclient
ln -s libclntsh.so.11.1 libclntsh.so
ln -s libocci.so.11.1 libocci.so
ln -s /usr/local/instantclient/libnnz11.so /lib/libnnz11.so
  • install libxml2-2.6.31-sol10 (don’t use 2.6.4 as its to new)

Download PHP source from here and run

./configure --with-oci8=shared,instantclient,/usr/local/instantclient --with-pdo-oci=shared,instantclient,/usr/local/instantclient,11.1.0.6.0
make

Don’t run make install

Copy oci8.so from the PHP source to coolstack path

cp [php_source]/modules/oci8.so /opt/coolstack/php5/lib/php/extensions/no-debug-non-zts-20060613/
cp [php_source]/modules/pdo_oci.so /opt/coolstack/php5/lib/php/extensions/no-debug-non-zts-20060613/
<pre>

Add the new extension to /opt/coolstack/php5/lib/php.ini
<pre>
[...]
extension=oci8.so
extension=pdo_oci.so
[...]

restart the web server instance

Informix PHP-PDO installation

Install m4 version 1.4.x get it from here

Download PDO Informix the page is here and the download is here
Compile from source

cd pdo_informix[source version]

/opt/coolstack/php5/bin/phpize

./configure --with-php-config=/opt/coolstack/php5/bin/php-config --with-pdo-informix=/usr/informix
make
make install

Or copy the module manually:
cp modules/pdo_informix.so /opt/coolstack/php5/lib/php/extensions/no-debug-non-zts-20060613/pdo_informix.so

Add the new extension to /opt/coolstack/php5/lib/php.ini

[...]
extension=pdo_informix.so
[...]

restart the web server instance

Cool stack PHP tips

  • To set a proxy for automatically package download
/opt/coolstack/php5/bin/pear config-set http_proxy http://user:password@10.10.10.10:8080
  • To list all settings
/opt/coolstack/php5/bin/pear config-show
  • To list all download channels
/opt/coolstack/php5/bin/pear list-channels

Some examples
Download mdb2 for oci8(Oracle) here

  • Install PHP MDB database support
/opt/coolstack/php5/bin/pear install /tmp/user/MDB2_Driver_oci8-1.4.1.tgz
/opt/coolstack/php5/bin/pear install pear/MDB2#oci8

To test php and get all available modules just create a file phpinfo.php with this content


0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
%d bloggers like this: