473,785 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP OCI8

Hi all,

We had to switch to windows 2003 server with IIS and now i've got a
problem with the OCI8 :(( Big time!

I know php works. I have tested this.
I know the oracle\bin is in the path. I checked.

At first I just made the extension active and then PHP stopped. Pages
wouldn't load and the IIS had to be restarted.

Eventhouh the oracle\bin was in the path I took out the oci.dll
because I know oci8.dll looks for it and put it in the windows dir.
Now PHP would work again and the phpinfo() tells me the OCI extenion
has been loaded.

Now I really want to use oracle and the first thing I encounter is:

Warning: ocilogon(): _oci_open_serve r: SĒ in F:\web\exp\test ORA.php on
line 10

No clear error message just some garbage. In this case SĒ.

I made the complete oracle directory read and execute, at first for
the IUSR user and later on for Everyone but that din't help. I know I
must be missing something and that's why I asking you.

Any suggestions?

TIA

Roger who lost a week up to now :(

Jul 17 '05 #1
8 19550
On Fri, 06 Feb 2004 12:49:06 +0100, "PI*****@HOME.N L" <PI*****@HOME.N L> wrote:
We had to switch to windows 2003 server with IIS and now i've got a
problem with the OCI8 :(( Big time!

I know php works. I have tested this.
I know the oracle\bin is in the path. I checked.

At first I just made the extension active and then PHP stopped. Pages
wouldn't load and the IIS had to be restarted.

Eventhouh the oracle\bin was in the path I took out the oci.dll
because I know oci8.dll looks for it and put it in the windows dir.
Stop - and put it back where it was. Once you start fiddling with an Oracle
install like this, Bad Things Happen.
Now PHP would work again and the phpinfo() tells me the OCI extenion
has been loaded.

Now I really want to use oracle and the first thing I encounter is:

Warning: ocilogon(): _oci_open_serve r: SĒ in F:\web\exp\test ORA.php on
line 10

No clear error message just some garbage. In this case SĒ.
Hm, not a good sign.
I made the complete oracle directory read and execute, at first for
the IUSR user and later on for Everyone but that din't help. I know I
must be missing something and that's why I asking you.

Any suggestions?


What version of Oracle and PHP?

As for the permissions, as well as Read and Execute I've got List Folder
Contents as well (makes sense since it might want to look for localised message
files?)

Do you have more than one Oracle home on the system?

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>
Jul 17 '05 #2
On Sat, 07 Feb 2004 12:59:11 +0000, Andy Hassall <an**@andyh.co. uk>
wrote:
On Fri, 06 Feb 2004 12:49:06 +0100, "PI*****@HOME.N L" <PI*****@HOME.N L> wrote:
We had to switch to windows 2003 server with IIS and now i've got a
problem with the OCI8 :(( Big time!

I know php works. I have tested this.
I know the oracle\bin is in the path. I checked.

At first I just made the extension active and then PHP stopped. Pages
wouldn't load and the IIS had to be restarted.

Eventhouh the oracle\bin was in the path I took out the oci.dll
because I know oci8.dll looks for it and put it in the windows dir.


Stop - and put it back where it was. Once you start fiddling with an Oracle
install like this, Bad Things Happen.
Now PHP would work again and the phpinfo() tells me the OCI extenion
has been loaded.

Now I really want to use oracle and the first thing I encounter is:

Warning: ocilogon(): _oci_open_serve r: SĒ in F:\web\exp\test ORA.php on
line 10

No clear error message just some garbage. In this case SĒ.


Hm, not a good sign.
I made the complete oracle directory read and execute, at first for
the IUSR user and later on for Everyone but that din't help. I know I
must be missing something and that's why I asking you.

Any suggestions?


What version of Oracle and PHP?

As for the permissions, as well as Read and Execute I've got List Folder
Contents as well (makes sense since it might want to look for localised message
files?)

Do you have more than one Oracle home on the system?


I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
first time I did give them the list right as well. So maybe this
little extra info can help.

Thanks.

Roger
Jul 17 '05 #3
On Fri, 06 Feb 2004 20:13:13 +0100, "PI*****@HOME.N L"
<PI*****@HOME.N L> wrote:
On Sat, 07 Feb 2004 12:59:11 +0000, Andy Hassall <an**@andyh.co. uk>
wrote:
On Fri, 06 Feb 2004 12:49:06 +0100, "PI*****@HOME.N L" <PI*****@HOME.N L> wrote:
We had to switch to windows 2003 server with IIS and now i've got a
problem with the OCI8 :(( Big time!

I know php works. I have tested this.
I know the oracle\bin is in the path. I checked.

At first I just made the extension active and then PHP stopped. Pages
wouldn't load and the IIS had to be restarted.

Eventhouh the oracle\bin was in the path I took out the oci.dll
because I know oci8.dll looks for it and put it in the windows dir.


Stop - and put it back where it was. Once you start fiddling with an Oracle
install like this, Bad Things Happen.
Now PHP would work again and the phpinfo() tells me the OCI extenion
has been loaded.

Now I really want to use oracle and the first thing I encounter is:

Warning: ocilogon(): _oci_open_serve r: SĒ in F:\web\exp\test ORA.php on
line 10

No clear error message just some garbage. In this case SĒ.


Hm, not a good sign.
I made the complete oracle directory read and execute, at first for
the IUSR user and later on for Everyone but that din't help. I know I
must be missing something and that's why I asking you.

Any suggestions?


What version of Oracle and PHP?

As for the permissions, as well as Read and Execute I've got List Folder
Contents as well (makes sense since it might want to look for localised message
files?)

Do you have more than one Oracle home on the system?

I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
first time I did give them the list right as well. So maybe this
little extra info can help.

Thanks.

Roger

And only 1 home :)
Jul 17 '05 #4
On Fri, 06 Feb 2004 20:27:14 +0100, "PI*****@HOME.N L" <PI*****@HOME.N L> wrote:
I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
first time I did give them the list right as well. So maybe this
little extra info can help.

And only 1 home :)


It's often best to trim everything down to basics when it starts Doing Weird
Things. The corrupted-looking message probably qualifies as weird.

A checklist off the top of my head, if you post replies to each point at least
it'll show where you stand:

(1) Environment:

What's in PATH?

echo $_ENV['PATH'];

Where's your Oracle home?

echo $_ENV['ORACLE_HOME'];

Although this may well not be set, since you're not actually supposed to set
ORACLE_HOME under Windows, unlike under Unix. (Oracle stores various bits of
information in the registry instead).

Others:

echo $_ENV['TNS_ADMIN'];
echo $_ENV['NLS_LANG'];

(2) Does sqlplus work from the command line?

sqlplus username/password@databa se

< do some stuff like select sysdate from dual >

(3) Does sqlplus work from PHP?

<pre>
<?php
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w")
);
$process = proc_open("sqlp lus test/test@dev92lnx", $descriptorspec , $pipes);
if (is_resource($p rocess)) {
fwrite($pipes[0], "select sysdate from dual;\n");
fclose($pipes[0]);

while(!feof($pi pes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[1]);
$return_value = proc_close($pro cess);

echo "command returned $return_value\n ";
}
?>
</pre>

(4) What does a minimal OCI8 example do? (alter username/password/database as
necessary):

<pre>
<?php
putenv("NLS_LAN G=ENGLISH_UNITE D KINGDOM.WE8ISO8 859P1");

if (!$conn = OCILogon("test" ,"test","dev92l nx")) {
$err = OCIError();
die($err['message']);
}

print "<hr>Server Version: " . OCIServerVersio n($conn) . "<hr>";

if (!$stmt = OCIParse($conn, "
select sysdate from dual
")) {
$err = OCIError();
die($err['message']);
}

if (!OCIExecute($s tmt)) {
$err = OCIError();
die($err['message']);
}

while (OCIFetchInto($ stmt, $row, OCI_ASSOC+OCI_R ETURN_NULLS)) {
print_r($row);
}

OCIFreeStatemen t($stmt);
OCILogoff($conn );
?>
</pre>

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>
Jul 17 '05 #5
On Sun, 08 Feb 2004 22:06:03 +0000, Andy Hassall <an**@andyh.co. uk>
wrote:
On Fri, 06 Feb 2004 20:27:14 +0100, "PI*****@HOME.N L" <PI*****@HOME.N L> wrote:
I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
first time I did give them the list right as well. So maybe this
little extra info can help.

And only 1 home :)


It's often best to trim everything down to basics when it starts Doing Weird
Things. The corrupted-looking message probably qualifies as weird.

A checklist off the top of my head, if you post replies to each point at least
it'll show where you stand:

(1) Environment:

What's in PATH?

echo $_ENV['PATH'];

Where's your Oracle home?

echo $_ENV['ORACLE_HOME'];

Although this may well not be set, since you're not actually supposed to set
ORACLE_HOME under Windows, unlike under Unix. (Oracle stores various bits of
information in the registry instead).

Others:

echo $_ENV['TNS_ADMIN'];
echo $_ENV['NLS_LANG'];

(2) Does sqlplus work from the command line?

sqlplus username/password@databa se

< do some stuff like select sysdate from dual >

(3) Does sqlplus work from PHP?

<pre>
<?php
$descriptorspe c = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w")
);
$process = proc_open("sqlp lus test/test@dev92lnx", $descriptorspec , $pipes);
if (is_resource($p rocess)) {
fwrite($pipes[0], "select sysdate from dual;\n");
fclose($pipes[0]);

while(!feof($pi pes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[1]);
$return_value = proc_close($pro cess);

echo "command returned $return_value\n ";
}
?>
</pre>

(4) What does a minimal OCI8 example do? (alter username/password/database as
necessary):

<pre>
<?php
putenv("NLS_LA NG=ENGLISH_UNIT ED KINGDOM.WE8ISO8 859P1");

if (!$conn = OCILogon("test" ,"test","dev92l nx")) {
$err = OCIError();
die($err['message']);
}

print "<hr>Server Version: " . OCIServerVersio n($conn) . "<hr>";

if (!$stmt = OCIParse($conn, "
select sysdate from dual
")) {
$err = OCIError();
die($err['message']);
}

if (!OCIExecute($s tmt)) {
$err = OCIError();
die($err['message']);
}

while (OCIFetchInto($ stmt, $row, OCI_ASSOC+OCI_R ETURN_NULLS)) {
print_r($row);
}

OCIFreeStateme nt($stmt);
OCILogoff($con n);
?>
</pre>


I'll give it a go tomorrow and tell you what happened :))

Thanks so far.

Roger
Jul 17 '05 #6
On Sat, 07 Feb 2004 23:49:40 +0100, "PI*****@HOME.N L"
<PI*****@HOME.N L> wrote:
On Sun, 08 Feb 2004 22:06:03 +0000, Andy Hassall <an**@andyh.co. uk>
wrote:
On Fri, 06 Feb 2004 20:27:14 +0100, "PI*****@HOME.N L" <PI*****@HOME.N L> wrote:
I'ts Oracle 9i and php 4.3.3 and eventhough I didn't mention it the
first time I did give them the list right as well. So maybe this
little extra info can help.

And only 1 home :)


It's often best to trim everything down to basics when it starts Doing Weird
Things. The corrupted-looking message probably qualifies as weird.

A checklist off the top of my head, if you post replies to each point at least
it'll show where you stand:

(1) Environment:

What's in PATH?

echo $_ENV['PATH'];

Where's your Oracle home?

echo $_ENV['ORACLE_HOME'];

Although this may well not be set, since you're not actually supposed to set
ORACLE_HOME under Windows, unlike under Unix. (Oracle stores various bits of
information in the registry instead).

Others:

echo $_ENV['TNS_ADMIN'];
echo $_ENV['NLS_LANG'];

(2) Does sqlplus work from the command line?

sqlplus username/password@databa se

< do some stuff like select sysdate from dual >

(3) Does sqlplus work from PHP?

<pre>
<?php
$descriptorsp ec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "w")
);
$process = proc_open("sqlp lus test/test@dev92lnx", $descriptorspec , $pipes);
if (is_resource($p rocess)) {
fwrite($pipes[0], "select sysdate from dual;\n");
fclose($pipes[0]);

while(!feof($pi pes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[1]);
$return_value = proc_close($pro cess);

echo "command returned $return_value\n ";
}
?>
</pre>

(4) What does a minimal OCI8 example do? (alter username/password/database as
necessary):

<pre>
<?php
putenv("NLS_L ANG=ENGLISH_UNI TED KINGDOM.WE8ISO8 859P1");

if (!$conn = OCILogon("test" ,"test","dev92l nx")) {
$err = OCIError();
die($err['message']);
}

print "<hr>Server Version: " . OCIServerVersio n($conn) . "<hr>";

if (!$stmt = OCIParse($conn, "
select sysdate from dual
")) {
$err = OCIError();
die($err['message']);
}

if (!OCIExecute($s tmt)) {
$err = OCIError();
die($err['message']);
}

while (OCIFetchInto($ stmt, $row, OCI_ASSOC+OCI_R ETURN_NULLS)) {
print_r($row);
}

OCIFreeStatem ent($stmt);
OCILogoff($co nn);
?>
</pre>


I'll give it a go tomorrow and tell you what happened :))

Thanks so far.

Roger


I found it :)) It all started with the $_ENV['PATH'] you suggested.
The above mentioned occurred on 2 machines. When I did the set in a
command windows the ora\bin was in the PATH. When I looked at the
$_ENV['PATH'] it wasn't. Don't ask me why but just restarting IIS and
loading php again didn't do the trick. A reboot of the server was
needed. Afterwards PHP and OCI worked on 1 of the machines :)) When I
took a closer look the second machine had a second ora home. Don't ask
me why but those idiots from Atos installed oracle twice. I added the
second ora\bin to the PATH, rebooted the machine and now this one is
working as well :))

Thanks for your help and the lesson learned? Always reboot M$
Windblows after installing or changing something.
Jul 17 '05 #7
> Thanks for your help and the lesson learned? Always reboot M$
Windblows after installing or changing something.


That or learn how to setup stuff right in the first place --- bad carpenter
will always blame his tools ....
Jul 17 '05 #8
On Sun, 08 Feb 2004 21:27:54 +0100, "PI*****@HOME.N L" <PI*****@HOME.N L> wrote:
When I did the set in a
command windows the ora\bin was in the PATH. When I looked at the
$_ENV['PATH'] it wasn't. Don't ask me why but just restarting IIS and
loading php again didn't do the trick.


IIS runs as a child of the IIS Admin service. This then runs as a child of
SERVICES.EXE. Processes inherit environment from their parent. Since you can't
really stop SERVICES.EXE without the system going tits up, changing the
environment seen by IIS without a reboot appears tricky, as changing the
environment for your command prompt or the system has no effect on other
already-running processes.

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>
Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
8494
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. 354 roberto@ausone:Build/php-4.3.2> ldd /opt/php4/bin/php libsablot.so.0 => /usr/local/lib/libsablot.so.0 libstdc++.so.5 => /usr/local/lib/libstdc++.so.5 libm.so.1 => /usr/lib/libm.so.1
0
3020
by: lok | last post by:
hi all, i have installed oracle9i client tools on RedHat7.3 (x86 machine) and i compiled php4.1.2 & apache1.3 successfully but when i execute php script in browser, error occured: "Fatal error: Call to undefined function: ocilogon()" i found no oci8.so in the whole system. i think this is the reason why the error occured
3
12687
by: Chad The Man | last post by:
I have been developing some applications on suse 9 / apache 1.37 / php 4.3.4 / Oracle 9i / OCI8. We recently moved servers, apache works fine, php works fine, oracle works fine... however, trying to connect to oracle from php it dies with the following error : Warning: ocilogon(): _oci_open_session: OCIHandleAlloc OCI_HTYPE_SVCCTX: OCI_INVALID_HANDLE Using SQL plus I can connect just fine. The variables are all set in apache and the...
1
3383
by: watayoune | last post by:
Hi, My apache (on win) crash when i start it, after i had oci8 extensions in php.ini ! 1. i had extension phph_oci8.dll in php.ini 2. i've got a php_oci8.dll in my php extensions dir 3. my exetnsion dirs are c:\php\extensions\ in php.ini 4. i've installed oci8 client 5. i've put my oci.dll (from oracle_home) in my windows dir (tips found
0
2126
by: RDahlstedt | last post by:
I am relatively new to PHP, but with over a decade of experience in C and other programming languages I can usually pick up a new programming language relatively quickly (to be reasonably productive not to know it inside out). My issues I believe may be either solely concentrated on the platform I am running PHP 5.0.0 on (MS Windows 2000) or just the Oracle OCI8 module (running against an Oracle 8.1.7.4 installation). In either case I am...
4
28129
by: cyrano | last post by:
I am having issues maintaining an oracle connection in my apache/php web application. I am able to succesfully connect to an Oracle 9i dbase using oci() and retrieve expected results for the first couple of attempts - then it dies with a msg in the apache error_log that looks like: PHP Warning: ocilogon() : OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the...
5
2880
by: Mladen Gogala | last post by:
The latest version of OCI8 1.2.1 doesn't work with LOB fields. There was an open bug, but Tony2001 was his usual helpful self, so he removed the bug and flatly denied its existence. I had to download 1.2.0 and reading CLOB fields started working again. Unfortunately, DBMS_METADATA.GET_DDL returns CLOB, so I was forced to discover this non-existing bug. PECL bug system is useless and maintainers are more suited for inquisitors then for...
5
8171
by: danish | last post by:
I download the oci-1.2.2.tgz file and generated the oci8.so file. After adding the extension=oci8.so in php.ini I get the error unable to load dynamic library /usr/lib/php4/oci8.so
0
4791
by: Yannick | last post by:
Hi, I'm Julien from France, We have recently install a new Web Server for my company The server is composed : - Linux RedHat RHEL4 U4 - Httpd-2.0.52-27.ent - Oracle Database 10.2.0.1
7
22096
by: eholz1 | last post by:
Hello All, I have reviewed various posts in regard to Oracle and PHP. I am running Apache 2.0.59, on Windows XP, with PHP 5.2. I would like to connect using PHP to a remote oracle db (ver. 7) I have uncommented out the php_oci8.dll and the older php_oracle.dll in the php.ini file the ini file resides in c:\php\php.ini
0
9491
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.