Hello Sriram-

This is straight from my documentation I created during adding Oracle
and MSSQL support. Perhaps it may be useful information. Anybody may
feel free to use any or all of it in whatever manner they like. Some of
it may be a bit sloppy. This was honestly my first real deployment on
Solaris (coming from Debian), so if you notice some things that are
strange, please feel free to point out my errors and correct them....

For what it's worth, on the MSSQL, I'm using the Sybase drivers. These
connect without problem to my MSSQL 2000 server, and I believe they
should also work with MSSQL 2005 Server.

Also are included sample database connect strings.

Cheers-
John

____________________________________________________________________
ORACLE Install Directions
1. Create the directory the Oracle instant client (note, I later had to
go back and download the 32 bit versions (even using Sparc 64) because
of how the PHP libraries are compiled?)
        mkdir -p /opt/oracle/instantclient
2. Download the two zip files to that folder and unzip them
        cp /root/Oracle/instantclient-* .
        cd /opt/oracle/instantclient
        unzip instantclient-basic-solaris64-10.2.0.3-20070101.zip
        unzip instantclient-sdk-solaris64-10.2.0.3-20070101.zip

        Clean it up a little:
        cd /opt/oracle/instantclient/instantclient_10_2
        mv * ..\..
        cd ..\..
        rmdir instantclient_10_2
        * now everything should be in /opt/oracle/instantclient

ORACLE_HOME=/opt/oracle/instantclient
export ORACLE_HOME


Download and install autoconf:
gzip -d autoconf-2.60-sol10-sparc-local.gz
pkgadd -d autoconf-2.60-sol10-sparc-local
PATH=$PATH:/usr/local/bin/
export PATH


download m4-1.4.7-sol10-sparc-local.gz from sunfreeware
gzip -d m4-1.4.7-sol10-sparc-local.gz
pkgadd -d m4-1.4.7-sol10-sparc-local

add /usr/ccs/bin to the path, so that it can find ld
PATH=/usr/ccs/bin:$PATH
export PATH

3. /opt/coolstack/php5/bin/pecl install oci8
        Enter in "instantclient,/opt/oracle/instantclient" when asked
for the path to the Oracle libraries

Edit /opt/coolstack/php5/lib/php.ini and add: extension="oci8.so"
Link a file so that the module can find a dependency:
        ln -s /opt/oracle/instantclient/libnnz10.so /lib/libnnz10.so    
        ln -s /usr/local/lib/libgcc.so.1 /opt/oracle/instantclient

4. Restart apache (svcadm restart network/http)
Look at the output of phpinfo now, and you should see oci8


____________________________________________________________________
To setup MS Sql database connectity, we'll use the FreeTDS project and
the Sybase drivers. 

Do some linking so FreeTDS can find things to build like it wants:
ln -s /opt/coolstack/include/sql.h /usr/local/include/sql.h
ln -s /opt/coolstack/include/sqlext.h /usr/local/include/sqlext.h
ln -s /opt/coolstack/include/sqltypes.h /usr/local/include/sqltypes.h


FREETDS-
FreeTDS is a library that will allow us to access Microsoft SQL Server
database instances from Unix. 

cd odbtp-1.1.4/
/usr/sfw/bin/gmake clean
./configure
/usr/sfw/bin/gmake 
/usr/sfw/bin/gmake install

chmod +x /opt/coolstack/src/php-5.2.0/scripts/phpize
ln -s /opt/coolstack/php5/lib/php /usr/local/lib/php
cd /opt/coolstac/src/php-5.2.0/ext/sybase
LD_LIBRARY_PATH=/usr/local/lib/
export LD_LIBRARY_PATH
LDFLAGS="-R/usr/local/lib" ./configure --with-sybase=/usr/local/freetds
--with-php-config=/opt/coolstack/php5/bin/php-config  
make
cp /opt/coolstack/src/php-5.2.0/ext/sybase/modules/sybase.so
/opt/coolstack/php5/lib/php/extensions/no-debug-non-zts-20060613/

edit /opt/coolstack/php5/lib/php.ini to add these entries:
extension="pdo_dblib.so"
extension="pdo_odbc.so"
extension="sybase.so"


Database sample connect/query strings:
____________________________________________________________________
Oracle- You'll need to use a connection string like this to connect to
DBNAME:
$db = '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =
oracleserver)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = DBNAME.WORLD)))';
$c = oci_new_connect('myusername', 'mypassword', $db);
 
____________________________________________________________________
MySQL- 

// MySQL Connection
$host = 'mysqlserver.whatever.com';
$user = 'myusername';
$pass = 'mypassword';
$db = 'mydatabase';
 
@$mysql_conn = mysql_connect($host, $user, $pass) or die('Could not
connect: ' . mysql_error());
@mysql_select_db($db) or die('Could not select database');
 

____________________________________________________________________
MSSQL-
                {
   $dbh = new PDO('dblib:host=sqlserverhost:1433;dbname=DBNAME',
'username', 'password');
   foreach ($dbh->query('select * from TABLE_NAME') as $row) {
      print_r($row);
   }
   $dbh = null;
} catch (PDOException $e) {
   print "Error: ".$e->getMessage()."<br/>";
   die();
}
____________________________________________________________________

-----Original Message-----
From: Sriram.Natarajan at Sun.COM [mailto:[email protected]] 
Sent: Thursday, October 25, 2007 4:23 PM
To: Tracy, John 
Cc: webstack-discuss at opensolaris.org
Subject: Re: [webstack-discuss] Additional PHP extensions for SXDE

Hi John
 Thanks for your response. It is nice to know that customers are indeed 
interested in MSSQL server support. I will start looking into the cost 
of integrating this extension . With respect MySQL and LDAP , these 
extensions will definitely be added in the upcoming integration.  With 
respect to Oracle database support - If I am not mistaken, one will need

to have Oracle client libraries installed on the system to add support 
for Oracle database. I will need to find out the licensing requirements.

Now, if integrate support for unixODBC or iODBC - then one should be 
able to use the ODBC driver manager and talk to these databases. I am 
not sure on the performance and stability aspect of these ODBC driver 
manager - I will definitely investigate on this as well.
 
 Our current integration already has support for GD libraries in 
2007/168 ARC case.
 
thanks
sriram

Tracy, John wrote:
> Hello Sriram-
>
> We are using Ldap, Mysql, and MSSQL (through FreeTDS). It would be
nice,
> although I believe impossible, if Oracle extensions were added (don't
> know about licensing and all that...). We seem to like our many
> different DB platforms around here...
>
> Are the GD libraries included in the existing ARC case?
>
> Thanks for asking-
> John
>
> -----Original Message-----
> From: webstack-discuss-bounces at opensolaris.org
> [mailto:webstack-discuss-bounces at opensolaris.org] On Behalf Of Sriram
> Natarajan
> Sent: Thursday, October 25, 2007 4:58 AM
> To: Webstack Discuss
> Subject: [webstack-discuss] Additional PHP extensions for SXDE
>
> HI
>  As we all know, PHP 5.2.4 has been integrated within SXDE build 73 
> onwards. This integration is based on previously approved ARC case : 
> PSARC/2007/552
> and PSARC/2007/168.    Some very useful PHP extensions like CGI / 
> FastCGI, LDAP, Kerberos, MySQL, Pear etc are not included within our 
> current integration. So, I am hoping that we can file additional ARC 
> case to track these new extensions.    So, here are the additional 
> extensions that I am considering to add support for. Please take a
look 
> at the below list and let us know your thoughts.
>
> - inifile -> Ability to read PHP INI file programmatically
>
> - cgi  / fastcgi ->  Support PHP to run in CGI or FastCI environment. 
> For example, this could allow Apache Worker MPM to execute PHP in 
> FastCGI environment.
>
> - dbase ->  Adds support for leveraging the bundled DBase library
>
> - flatfile  -> Adds support for different file based databases
>
> - ndb / cdb -> Abstraction layer for leveraging the bundled database 
> libraries.
>
> - SQLite -> Adds support for SQLite database. SQLite is a small C 
> library that implements a self-contained, embeddable,
zero-configuration
>
> SQL database engine.
>
> - mysql - MySQL support . This can be added as soon as MySQL support 
> gets integrated within SXDE
>
> - xdebug -> Adds debugging support through IDE like Netbeans
>
> - pdo / pdo-sqlite -> Enable PHP data objects support.  Also enables 
> SQLite database to be accessed as PHP objects.
>
> - pear ->  Allows PHP programmers to dynamically download and install 
> 3rd party PHP extensions that are available from either pecl.php.net
or 
> pear.php.net
>
> - ldap / kerberos -> Authentication support for php programmers.  Uses

> Sun's LDAP and Kerberbos libraries here.
>
> - pspell -> Dictionary support for programmers
>
> - snmp - Add snmp support for  PHP programmers
>
> Here are the other popular extensions that we cannot still add support

> at this time because of missing 3rd party library dependency
>
> - unixODBC  - Need unixODBC libraries
>
> - gdbm / qdbm -> Need external native database library that is not 
> bundled within PHP.
>
> - ncurses -> Need ncurses library in /usr/sfw
>
> - readline -> Need readline library in /usr/gnu
>
> - imap  -> Need IMAP library in /usr/sfw
>
> - gmp -> Needs GNU MP library in /usr/gnu
>
> - mssql[=DIR]      Includes support for Microsoft SQL Server. 
> Unfortunately, this requires FreeTDS libraries to be installed in
> /usr/sfw
>
> - unixODBC/ iODBC -> support for ODBC Driver Manager. Again, this 
> requires appropriate native libraries to be installed within Solars.
>
> If you happen to know any popular extension that is not captured in
the 
> above list, please please let us know. This information could be
useful 
> in determining what other extensions to include so that PHP developers

> can comfortably develop and deploy PHP based web applications on
> Solaris.
>
> thanks
> sriram
> _______________________________________________
> webstack-discuss mailing list
> webstack-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
> _______________________________________________
> webstack-discuss mailing list
> webstack-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
>   

Reply via email to