Apache+PHP+Oracle+Windows -issue 
Author Message
 Apache+PHP+Oracle+Windows -issue

Greetings. I've encountered a rather frustrating problem. I'm supposed to
install PHP and Apache to a Windows 2000 -machine and setup a few
scripts, that would use an Oracle database. I've succesfully installed
Apache, installed PHP and installed the oracle client. The webserver
works, PHP works, the client works, but these don't work together. I'm
able to call up a PHP script with apache (from a web browser for
example) and it works just fine. I can also execute a PHP script from
command prompt and access the oracle database with it. But I can't call a
script, that would access the database, from Apache.

At first I couldn't access the database with PHP at all. It gave me the
"invalid NLS parameter" -error. So I set up the NLS_LANG environment
variable (in the control panel->System) and then the script started
working from the command prompt. But still I can't use the database by
calling up an appropriate script from the webserver. It still gives me the
same NLS-error. The script works fine and it outputs the HTML, but the
functions (ora_logon) that use the database come up with nothing.

The TNSNames have to be correct, because I can access the database with
PHP from the command prompt. And the NLS_LANG -variable seems to be
correct as well for the same reason. And yes I've restarted the webserver
several times.

What could I possibly try to do? Any help would be greatly appreciated!

Regards,

Erik Forsstr?m



Sun, 24 Apr 2005 18:02:01 GMT  
 Apache+PHP+Oracle+Windows -issue

Don't know too much about this installation under windows, but I do
under *nix. There, the php executable needs to built differently for
webserver ( apache, iplanet, etc ) support, that it does for
standalone use... in other words, you're using a different program to
support the web to the one you're using standalone.

It this is the same under windows, then you may have the standalone
exe that supports oracle, and the apache one that doesn't have it
built in.

HTH,

Steve


Quote:
>Greetings. I've encountered a rather frustrating problem. I'm supposed to
>install PHP and Apache to a Windows 2000 -machine and setup a few
>scripts, that would use an Oracle database. I've succesfully installed
>Apache, installed PHP and installed the oracle client. The webserver
>works, PHP works, the client works, but these don't work together. I'm
>able to call up a PHP script with apache (from a web browser for
>example) and it works just fine. I can also execute a PHP script from
>command prompt and access the oracle database with it. But I can't call a
>script, that would access the database, from Apache.

>At first I couldn't access the database with PHP at all. It gave me the
>"invalid NLS parameter" -error. So I set up the NLS_LANG environment
>variable (in the control panel->System) and then the script started
>working from the command prompt. But still I can't use the database by
>calling up an appropriate script from the webserver. It still gives me the
>same NLS-error. The script works fine and it outputs the HTML, but the
>functions (ora_logon) that use the database come up with nothing.

>The TNSNames have to be correct, because I can access the database with
>PHP from the command prompt. And the NLS_LANG -variable seems to be
>correct as well for the same reason. And yes I've restarted the webserver
>several times.

>What could I possibly try to do? Any help would be greatly appreciated!

>Regards,

>Erik Forsstr?m



Sun, 24 Apr 2005 23:49:34 GMT  
 Apache+PHP+Oracle+Windows -issue
but the

Quote:
> functions (ora_logon) that use the database come up with nothing.

ora_logon -->  oracle extension. Old way to access to Oracle
ocilogon  --> oci8 extension. The newest extension, for both oracle 7 and
oracle 8. You should use this one.

 Regards,

Philippe



Sun, 24 Apr 2005 21:26:49 GMT  
 Apache+PHP+Oracle+Windows -issue

Quote:
>Greetings. I've encountered a rather frustrating problem. I'm supposed to
>install PHP and Apache to a Windows 2000 -machine and setup a few
>scripts, that would use an Oracle database.

 Oracle version (client and database)? PHP version?

Quote:
>I've succesfully installed
>Apache, installed PHP and installed the oracle client. The webserver
>works, PHP works, the client works, but these don't work together. I'm
>able to call up a PHP script with apache (from a web browser for
>example) and it works just fine. I can also execute a PHP script from
>command prompt and access the oracle database with it. But I can't call a
>script, that would access the database, from Apache.

>At first I couldn't access the database with PHP at all. It gave me the
>"invalid NLS parameter" -error.

 ORA-12700? ORA-12702? ORA-12705?

Quote:
> So I set up the NLS_LANG environment
>variable (in the control panel->System)

 To what value?

Quote:
>and then the script started
>working from the command prompt. But still I can't use the database by
>calling up an appropriate script from the webserver. It still gives me the
>same NLS-error. The script works fine and it outputs the HTML, but the
>functions (ora_logon) that use the database come up with nothing.

 ora_logon uses the ancient OCI7 interface, forget it and use the OCI8 module
instead.

Quote:
>The TNSNames have to be correct, because I can access the database with
>PHP from the command prompt. And the NLS_LANG -variable seems to be
>correct as well for the same reason. And yes I've restarted the webserver
>several times.

>What could I possibly try to do? Any help would be greatly appreciated!

 Give some more information possibly...

--

http://www.andyhsoftware.co.uk/space | disk usage analysis tool



Mon, 25 Apr 2005 06:06:37 GMT  
 Apache+PHP+Oracle+Windows -issue

Quote:

> but the
>> functions (ora_logon) that use the database come up with nothing.
> ora_logon -->  oracle extension. Old way to access to Oracle
> ocilogon  --> oci8 extension. The newest extension, for both oracle 7 and
> oracle 8. You should use this one.

Oh dear... just my luck. I've already completed a large application using
the oracle extension. So rewriting all the database operations is going to
be a pain. Why oh WHY did I not learn about the oci8 extension before.

Well... either I get the {*filter*}y thing to work on the server (it works on
my workstation) or I rewrite the whole thing, assuming it works even then.
Better to do some testing.

--
           /------/--------------------\------\------/---------------\
          /------/    Erik Forsstr?m    \------\----/  "I never get   \
*--------/     At the University of Kuopio      \--/ involved with my  \
*--------\     http://www.*-*-*.com/ ~forsstro    /--\  own life. Too    /

           \------\--------------------/------/------\---------------/



Mon, 25 Apr 2005 14:53:52 GMT  
 Apache+PHP+Oracle+Windows -issue

Quote:
> Oh dear... just my luck. I've already completed a large application using
> the oracle extension. So rewriting all the database operations is going to
> be a pain. Why oh WHY did I not learn about the oci8 extension before.

> Well... either I get the {*filter*}y thing to work on the server (it works on
> my workstation) or I rewrite the whole thing, assuming it works even then.
> Better to do some testing.

I've compiled php with oci8 extension, but I never use oci functions
directly... I always use an abstract layer.
(there are several ones : adodb, pear_db, metabase, .... my favorite is
adodb). Thus, I could switch to an other db without making changes in my
apps. And, even if I don't change the db (this is the case), I can use
friendly functions to manipulate my datas. See
http://www.*-*-*.com/

Best regards,

Philippe



Mon, 25 Apr 2005 17:55:04 GMT  
 Apache+PHP+Oracle+Windows -issue
Well the problem has been solved. The problem, in the end, was indeed with
the NLS_LANG values. For some strange reason, the values were listed as
"NA" in the Windows registry even after I had tried to set them through
the environment variables (which worked on my workstation btw). So I
manually went through every instance (in regedit) and updated the NLS_LANG
variable to FINNISH_FINLAND.WE8...* and then the {*filter*}y thing started to
work.

Thanks for all your answers, though!

Regards,

Erik Forsstr?m



Mon, 25 Apr 2005 20:13:13 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Apache PHP & Oracle - w2k

2. PHP + Apache + PostgreSQL + Cygwin + Windows?

3. Windows Apache 2 / PHP 4.3 Setup

4. Apache + PHP not processing php

5. php is not interpreted (apache 2.0.43, php 4.3.0, linux)

6. Installing PHP on IIS 6.0 (Windows.NET) Issues

7. Python+Apache+Oracle+???Persistent database connection???

8. php/apache failing to find phpinfo

9. How to enable php on apache?

10. Apache Error with PHP

11. A question about PHP/Apache setup

12. Looking for development package for Apache/PHP/MySQL

 

 
Powered by phpBB® Forum Software