I am trying to use sql server 7 with the current version of php which I just installed, but this is what happens when using the dl function. I am using Windows 2000.

"Warning: dl(): (null): Unable to initialize module Module compiled with module API=20040412, debug=0, thread-safety=1 PHP compiled with module API=20020429, debug=0, thread-safety=1 These options need to match in"

I am using the ntwdblib.dll that came with SQL Server 7, but get the same error regardless of what version of ntwdblib.dll I use, so I guess that has nothing to do with it. I saw a post on the web that claims you can get this by doing multiple installs, but I don't know why that would be. I would guess those API numbers may need to match but don't know what to do about it. Any ideas or solutions?

    5 days later

    Hi,

    did you upgrade php to a new version ? If so you might need to copy all the module dlls of the new version to the system32 directory.

    The PHP version and the module version differ (which happens if you try to load an older module with a newer PHP version)

    Thomas

      I got past that. Was a mismatch between source code and install program. I have a new problem setting up mssql though.

      Why do I get unable to load dynamic library? The file exists, as is proved by the code I wrote. Are step by step instructions available to setup PHP to use SQL Server?

      Response I get is:

      Let's see if we can load this extension: mssql
      First check for file: G:\php437\ext\php_mssql.dll
      File Exists!
      Warning: dl(): Unable to load dynamic library 'G:\php437\ext\php_mssql.dll' - The specified module could not be found. in G:\ASP\php_check_sql.php on line 16

      did it load it? (php_mssql.dll)

      The code being run is:

      <?php
      $ext = 'mssql';
      $prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
      echo '<br />Let\'s see if we can load this extension: ' . $ext;
      $dir = "G:\php437\ext\";
      $fn = $prefix . $ext . ".dll";
      echo "<br />First check for file: " . $dir . $fn;
      //$handle = fopen($dir . $fn, "r");
      $handle = file_exists($dir . $fn);
      if ($handle)
      echo "<br />File Exists!";
      else
      echo "STUPID!";

      if (!extension_loaded($ext)) {

      dl($fn);
      echo '<br />did it ' . 'load it? (' . $fn . ')';
      }
      else
      {
      echo '<br />well, i guess' . ' it is already there';
      }
      ?>

        Hi,

        did you copy the contents of the dlls folder (bundled with zip version of PHP) to system32 ? You need ntwdblib.dll.

        Thomas

          Originally posted by tsinka
          Hi,

          did you copy the contents of the dlls folder (bundled with zip version of PHP) to system32 ? You need ntwdblib.dll.

          Thomas

          That cleared it up. Thanks. Now I will do more testing.

            Write a Reply...