in reply to Re: Win32/DBD::ODBC: works from cmd.exe, not works from apache (xampp)
in thread Win32/DBD::ODBC: works from cmd.exe, not works from apache (xampp)

E: is not a network drive, and if it was then script would not work from cmd.exe either. But it works from cmd.exe.

Apache/XAMPP is not started as a service, but as a regular process under the same user (me) that is starting the same script from cmd.exe.

I would understand if a Perl from apache couldn't have access to files in e:/db/. But it can list the files.

I would understand if a Perl from apache couldn't have access to ODBC. But it can list system DSNs from ODBC driver.

  • Comment on Re^2: Win32/DBD::ODBC: works from cmd.exe, not works from apache (xampp)

Replies are listed 'Best First'.
Re^3: Win32/DBD::ODBC: works from cmd.exe, not works from apache (xampp)
by Anonymous Monk on Nov 28, 2016 at 08:06 UTC
    What happens if you do system $^X, 'full/path/to/file/that/works/from/cmd.pl' from within apache program?
      The same error:
      Content-Type: text/html; charset=utf-8 ERROR ODBC: [Microsoft][ODBC dBase Driver] Disk or network error. (SQL +-HY000)

        This means that when your Apache server / user runs your program, something in the permissions or environment or whatever ($ENV{PATH}?) is different from when you run the program manually. I don't know what knobs and levers there are to the Apache configuration, but if it is run under the same interactive user as when you start the program manually, it's either %ENV or something that should be documented somewhere in the Apache documentation...

        check your connection string, and db password/ip restrictions