Re: PHP4 Apache Module and Network Drives

From: Date: Wed, 09 Aug 2000 16:32:37 +0000
Subject: Re: PHP4 Apache Module and Network Drives
References: 1 2 3 4 5  Groups: php.windows 
Request: Send a blank email to php-windows+get-1681@lists.php.net to get a copy of this message
Andy Hoffman wrote: > Why would php running at command line be able to find the > dlls (network oracle bin directories in the path), but not php running w/in > apache (where the network drive/path doesn't show up in apache's path > environment setting)... does php look to DIFFERENT path settings at the > command line vs. within apache? And why doesn't apache include the network > drive/directories in it's path environment anyway? OK, figured a few more things out :) there I go trying to be smarter than my computer again -wink-wink- In an effort to determine if indeed apache/php was having problems reaching the network drives, I created a simple test, using php, apache, MS Access and odbc. This test is repeatable, at least here. 1) I created a simple access database (single table with just a couple fields/records) and saved it on my network drive. 2) Added an odbc data source (Access drivers) called "myaccess" and selected the mdb file on the network as the database file. 3) Tried a simple connection test using odbc_connect w/in php4.0.2dev... *** from odbcaccess.php *** <?php $conn=odbc_connect("myaccess","scott","tiger"); if (!$conn) { echo "<p>Didn't work</p>"; } else { echo "<p>Connected Sucessfully!</p>"; } ?> 4) Got the following error message from odbc driver under php/apache... *** output in browser *** Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides., SQL state S1009 in SQLConnect in c:/dreamwebs/phptest/odbcaccess.php on line 12 Didn't work ****** 5) Made a copy of the SAME mdb file on my local machine at the root of C:\ 6) Went back into ODBC data sources, and only changed the location of the mdb file to the copy on local drive (changed nothing else). 7) Rerun same script (just hit "Reload"), and get the follwing output: *** output in browser *** Connected successfully! ****** So, the ONLY difference was WHERE the mdb file lives (either local drive, or on a mapped network drive). What could be the issue? Not pathing out to the network? Well, one would think the ODBC driver itself would handle that issue, since it is fully pathed to the source mdb file. Network protocols? Let's say this is a Novell network, and the main transport protocol to network servers is IPX/SPX (not TCP/IP)... could that cause the problem? Not sure. Any thoughts? -- Andy Hoffman Web Developer Bristol-Myers Squibb email: andy.hoffman@bms.com

« previous php.windows (#1681) next »