Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: mod_fcgid disables php_oci8? |
|
Author |
|
halfer
Joined: 31 Jan 2007 Posts: 19
|
Posted: Wed 31 Jan '07 18:30 Post subject: mod_fcgid disables php_oci8? |
|
|
Hi all
New forum member here! I am running Apache 2.0.59 on Windows XP SP2 with a fairly large application using PHP 5.1.6 in CGI mode. It doesn't run as fast as it could so I'd like to speed it up, on my dev, test and production environments. I believe that mod_php and FastCGI are both options. Given that the latter is (I think) similar to CGI, I have started to trial this option. I have downloaded the fcgid binary for the Apache 2.0 branch, which is this:
http://www.apachelounge.com/download/
and this appears to start up fine. My apache config looks like this:
Code: | LoadModule fcgid_module modules/mod_fcgid/mod_fcgid.so
DefaultInitEnv PHPRC "C:/PHP5/"
DefaultInitEnv PATH "C:/PHP5;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/system32/wbem;"
DefaultInitEnv SystemRoot "C:/WINDOWS"
DefaultInitEnv SystemDrive "C:"
DefaultInitEnv TEMP "C:/WINDOWS/Temp"
DefaultInitEnv TMP "C:/WINDOWS/Temp"
DefaultInitEnv windir "C:/WINDOWS"
<Directory "C:/Program Files/Apache Group/Apache2/frameworks/symfony-stable">
Options +ExecCGI
SetHandler fcgid-script
FCGIWrapper "C:/PHP5/php-cgi.exe" .php
</Directory> |
I have got phpinfo() to work. The problem I have is that the oci8 module no longer appears in the phpinfo() output, but strangely it does from php -i and php-cgi -i. As a result, the oci8 functionality under this mode is not available to applications as it was previously. I have checked in the phpinfo() output that the "CGI/FastCGI" is in effect, and that I am editing the correct php.ini (which is the same as the old one running in CGI mode).
Any ideas what I am doing wrong? If I need to add further info to get sensible answers please let me know |
|
Back to top |
|
halfer
Joined: 31 Jan 2007 Posts: 19
|
Posted: Wed 31 Jan '07 18:43 Post subject: More info |
|
|
I should mention that upon disabling the fcgid directives, and restoring the previous PHP configuration, phpinfo() reports the server mode as "Apache 2.0 Handler" and oci8 and oracle support are restored, and all is fine and dandy (just slow!).
Thanks all |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Wed 31 Jan '07 20:01 Post subject: |
|
|
It looks you are missing some environment/path variables
I do not know oci8 and oracle, but try to add them with DefaultInitEnv and/or add to the DefaultInitEnv PATH |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Wed 31 Jan '07 22:26 Post subject: |
|
|
From the oracle site:
If PATH is set incorrectly or the Oracle libraries cannot be found, starting Apache will give an alert: "The dynamic link library OCI.dll could not be found in the specified path." The Environment section of the phpinfo() page will show the values of PATH and the Oracle variables actually being used by PHP.
So try to look at phpinfo which paths are used when running as Apache 2.0 Handler. And add them in the DefaultInitEnv PATH line
Also look at ventually Oracle env varibles used by windows (my computer/properties/advanced ) and add them with DefaultInitEnv xxx yyy
Steffen |
|
Back to top |
|
halfer
Joined: 31 Jan 2007 Posts: 19
|
Posted: Thu 01 Feb '07 12:20 Post subject: Thank you! |
|
|
Thank you Steffen for this invaluable advice. With your hints I compared the environments as reported by phpinfo(), in both modes, and found that the following were missing, so I added them:
PATH: C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin (plus others)
WV_GATEWAY_CFG: C:\oracle\ora92\Apache\modplsql\cfg\wdbsvr.app
Once set up using DefaultInitEnv, the oci8 module popped back into the phpinfo output, which is very encouraging. Incidentally I didn't get any startup errors in my Apache log despite a LogLevel of Debug, which is why this issue was a bit hard to track down - there was no output to help track down the problem. Interestingly PATH seems to be truncated in this mode, but enough of it appears to get Oracle started up.
Thanks again for your assistance, and hopefully the details above will assist others who come across the same issue.
|
|
Back to top |
|
halfer
Joined: 31 Jan 2007 Posts: 19
|
Posted: Thu 25 Oct '07 13:20 Post subject: |
|
|
Ran into the same problem again with the Oracle 10 Instant Client, although this time oci8 appeared in phpinfo() as normal, but connection attempts would time out and throw a fatal error.
The solution was to simply set TNS_ADMIN using DefaultInitEnv to the path as per the environment var of the same name, and it started to work again. |
|
Back to top |
|
|
|
|
|
|