If you are using Apache as your webserver, you need to pass environment variables explicitly using the PassEnv directive.
No good deed goes unpunished. -- (attributed to) Oscar Wilde
| [reply] |
I am using Apache as my web server.
Can you give a little more info on this?
Do I pass the variables in the Perl script or the HTML that calls the script? And which environment variables do I pass?
Is there perhaps a sample script of this that I can download and look at?
Right now I'm thinking the cause of this problem as that my Perl script is being run as another user and does not have network security rights over the network.
thanks,
bill
| [reply] |
I'm not at work, so I'll have to punt a little -- I'll fill in more detail when I get back in tomorrow. Basically, I think you will want to modify your httpd.conf file to explicitly pass the environment variables that you want to be available when you execute programs as the webuser (also defined in your httpd.conf). The link to PassEnv that I specified above shows the edited portion of the httpd.conf. Once you've changed httpd.conf, then you need to stop and restart Apache.
Hmmm. Now that I look more closely at your original question, I see that you are on a Windows platform -- my experience is all on the Unix side. I had to look up what a Universal Naming Convention (UNC) path was. All this is to say that I may be leading you up a blind alley. If so, please accept my apologies, and perhaps someone who actually knows how to solve this problem will respond. :)
Update: I modified Apache's httpd.conf file with the following Directory tag, passing $ENV{LD_LIBRARY_PATH} from webuser's profile to any script executed by the webserver:
<Directory />
Options FollowSymLinks
AllowOverride None
PassEnv LD_LIBRARY_PATH PATH
</Directory>
Not sure if this will help you. | [reply] [d/l] |
sounds like the webserver runs the script as another user than the shell, i.e. too little rights on the UNC share for that web user. If you use Internet Information server, the script normally runs as IUSR_$servername. Or if you use a connection created by Window's ODBC-Manager, you have to use a System-DSN, not a User-DSN
Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"
| [reply] |
I think you may be partially right on this issue.
However, I have setup the ODBC DSN as a System DSN for Microsoft FoxPro. When I manually go into Excel and try to open the database through the ODBC DSN, I can open it fine.
But when the Perl script begins, I get "Cannot Connect."
When I copy the database to the same web server machine, I can also open it locally through the ODBC driver with no problem.
I am running this on an Apache web server. Is there perhaps a default User name that the apache web server uses when attempting to connect over the network?
thanks,
bill
| [reply] |
Sounds like an environment variable might be missing in your web server environment. Does this give you any ideas? | [reply] |