473,414 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

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_server: SĒ in F:\web\exp\testORA.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 19517
On Fri, 06 Feb 2004 12:49:06 +0100, "PI*****@HOME.NL" <PI*****@HOME.NL> 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_server: SĒ in F:\web\exp\testORA.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.andyhsoftware.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.NL" <PI*****@HOME.NL> 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_server: SĒ in F:\web\exp\testORA.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.NL"
<PI*****@HOME.NL> 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.NL" <PI*****@HOME.NL> 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_server: SĒ in F:\web\exp\testORA.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.NL" <PI*****@HOME.NL> 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@database

< 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("sqlplus test/test@dev92lnx", $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], "select sysdate from dual;\n");
fclose($pipes[0]);

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

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_LANG=ENGLISH_UNITED KINGDOM.WE8ISO8859P1");

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

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

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

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

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

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

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.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.NL" <PI*****@HOME.NL> 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@database

< 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("sqlplus test/test@dev92lnx", $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], "select sysdate from dual;\n");
fclose($pipes[0]);

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

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_LANG=ENGLISH_UNITED KINGDOM.WE8ISO8859P1");

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

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

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

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

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

OCIFreeStatement($stmt);
OCILogoff($conn);
?>
</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.NL"
<PI*****@HOME.NL> 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.NL" <PI*****@HOME.NL> 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@database

< 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("sqlplus test/test@dev92lnx", $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], "select sysdate from dual;\n");
fclose($pipes[0]);

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

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_LANG=ENGLISH_UNITED KINGDOM.WE8ISO8859P1");

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

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

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

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

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

OCIFreeStatement($stmt);
OCILogoff($conn);
?>
</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.NL" <PI*****@HOME.NL> 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.andyhsoftware.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
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. ...
0
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:...
3
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...
1
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...
0
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...
4
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...
5
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...
5
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
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
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)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...

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.