[PHP] Oracle Interface

2005-06-10 Thread Shane Presley
Where can I find some info on integrating Oracle and PHP?

I had some PHP front ends to a MySQL database, worked great.  Our DBAs
want to change the back end from MySQL to Oracle 10g.  How hard would
it be to convert my PHP scripts, and where would I go to read up on
Oracle <--> PHP?

Thanks
Shane

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Oracle Interface

2005-06-13 Thread Shane Presley
On 6/10/05, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Fri, June 10, 2005 8:48 am, Shane Presley said:
> > Where can I find some info on integrating Oracle and PHP?
> 
> http://php.net/oracle
> 
> pretty much covers it.

Thanks!  You're right, that looks pretty straight forward.  Although I
do have two additional questions...

How do I find out how my PHP was compiled? The documentation states:
  You have to compile PHP with the option --with-oracle[=DIR], where
DIR defaults to your environment variable ORACLE_HOME.

But I'm using PHP from the Red Hat default install (I didn't compile it).

Also, do you know if this is Oracle version independent.  More
specifically will this work with Oracle 10g?

Thanks
Shane

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Oracle Interface

2005-06-13 Thread Shane Presley
On 6/13/05, Jay Blanchard <[EMAIL PROTECTED]> wrote:
> To find out how your PHP was compiled create a test page with this
> only...
> 
>  
> phpinfo();
> 
> ?>
> 
> And then load the page from your web server. It will return a wealth of
> information to you. As far as Oracle compatability it would be hard to
> know with the info you provided, but you'll find out things like PHP
> version when you do the test page.
> 

Thanks!  So it looks like PHP wasn't compiled with the needed variable.

PHP Version 4.3.2

'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux'
'--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin'
'--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--cache-file=../config.cache'
'--with-config-file-path=/etc'
'--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect'
'--disable-debug' '--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-bz2' '--with-db4=/usr'
'--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin'
'--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd'
'--enable-gd-native-ttf' '--with-ttf' '--with-gettext'
'--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr'
'--with-openssl' '--with-png' '--with-pspell' '--with-regex=system'
'--with-xml' '--with-expat-dir=/usr' '--with-pcre-regex=/usr'
'--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif'
'--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-discard-path' '--enable-track-vars' '--enable-trans-sid'
'--enable-yp' '--enable-wddx' '--enable-mbstring'
'--enable-mbstr-enc-trans' '--enable-mbregex'
'--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl'
'--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared'
'--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath'
'--enable-shmop' '--enable-versioning' '--enable-calendar'
'--enable-dbx' '--enable-dio' '--enable-mcal'
'--with-apxs2filter=/usr/sbin/apxs'

However, there is a section about dbx...

dbx support enabled
dbx version 1.0.0
supported databases MySQL ODBC PostgreSQL Microsoft SQL Server
FrontBase Oracle 8 (oci8) Sybase-CT

Not sure what that is?

Shane

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Compiling problem (apxs)

2005-06-15 Thread Shane Presley
Hello,

I have a RedHat system running Apache and PHP Version 4.3.2.  These
were pre-installed Red Hat packages.  Things worked nicely.

But I needed to recompile PHP, because I need Oracle support, and this
package wasn't compiled with

  --with-oracle=/path/to/oracle/home/dir
  --with-oci8=/path/to/oracle/home/dir

So I downloaded the source, and tried to setup the ./configure with
the same options as the existing version, plus the two oracle lines.

But the compile fails with 

checking for Apache 1.x module support via DSO through APXS... 

Sorry, I was not able to successfully run APXS.  Possible reasons:

1.  Perl is not installed;
2.  Apache was not compiled with DSO support (--enable-module=so);
3.  'apxs' is not in your path.  Try to use --with-apxs=/path/to/apxs
The output of apxs follows
./configure: line 3169: apxs: command not found
configure: error: Aborting

What's odd is that when I look at phpinfo for the running PHP, it says
it was compiled like that.  But it's true that apxs does not exist on
the system.

Do I have to recompile Apache as well?  When I tried it without apxs,
it compiled and installed fine, but Apache was still loading the old
libphp4.so.  So the Apache version was still without Oracle.

All I'm trying to do is get PHP running with Oracle support. 

Thanks
Shane

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Apache fails to start (oracle path problem?)

2005-06-15 Thread Shane Presley
Hello,

I'm having trouble compiling and running PHP with oracle support.

I was able to compile with the appropriate configure script, but only
after I set my Oracle environment variables in my shell.  That was no
problem.

The problem is, when Apache goes to load the php module, it fails,
because it can't find the oracle library.  Interactively I had to do
this...

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

But Apache..
Starting httpd: Syntax error on line 207 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/httpd/modules/libphp4.so into server:
libclntsh.so.10.1: cannot open shared object file: No such file or
directory
[FAILED]


Not sure how I could set that for Apache?

Shane

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Apache fails to start (oracle path problem?)

2005-06-15 Thread Shane Presley
Thank you! That fixed it.  I just had to define the Oracle env
variables on the httpd startup script.

So that was a huge help :)

Shane

On 6/15/05, Kristen G. Thorson <[EMAIL PROTECTED]> wrote:
> I ran into a similar problem trying to get ODBC working with a Progress
> database.  I managed to solve it by setting the environment variables in
> the httpd startup script.
> 
> Not much help, I know, but a suggestion. ;)
> 
> good luck
> kgt
> 
> 
> 
> 
> Shane Presley wrote:
> 
> >Hello,
> >
> >I'm having trouble compiling and running PHP with oracle support.
> >
> >I was able to compile with the appropriate configure script, but only
> >after I set my Oracle environment variables in my shell.  That was no
> >problem.
> >
> >The problem is, when Apache goes to load the php module, it fails,
> >because it can't find the oracle library.  Interactively I had to do
> >this...
> >
> >export LD_LIBRARY_PATH=$ORACLE_HOME/lib
> >
> >But Apache..
> >Starting httpd: Syntax error on line 207 of /etc/httpd/conf/httpd.conf:
> >Cannot load /usr/lib/httpd/modules/libphp4.so into server:
> >libclntsh.so.10.1: cannot open shared object file: No such file or
> >directory
> >[FAILED]
> >
> >
> >Not sure how I could set that for Apache?
> >
> >Shane
> >
> >
> >
> 
> 
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Showing tables (converting from MySQL to Oracle)

2005-06-23 Thread Shane Presley
Hello,

I've recompiled PHP to use Oracle, and been able to run a quick test
script that looks like...




So now I'm going through and converting my MySQL code to Oracle.  I've
finished the connect functions, but getting hung up on how to do
queries.  For example the first query wants to SHOW TABLES.  Not sure
how to do this with Oracle calls?

function get_tables($link) {
$tableList = array();
$query = "SHOW TABLES";
$result = perform_query($query, $link);
while($row = fetch_array($result)) {
array_push($tableList, $row[0]);
}

return $tableList;
}


function perform_query($query, $link) {
if($link) {
$result = mysql_query($query, $link) or die('Query
failed: ' . mysql_error());
}
else {
die('No DB link');
}

return $result;
}


Thanks!
Shane

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php