No announcement yet.

ADONewConnection: Unable to load database driver '' (quick&dirty fixed for me)

  • Filter
  • Time
  • Show
Clear All
new posts

  • ADONewConnection: Unable to load database driver '' (quick&dirty fixed for me)

    I had a project, I deployed it as I did many times but there was always this error:
    ADONewConnection: Unable to load database driver ''
    Fatal error: Call to a member function Connect() on boolean in /***/***/***/scriptcase/_lib/prod/lib/php/nm_session.php on line 430

    those asterix *** is the (from me for this post hidden) path to the scriptcase directory on the production server

    Again an again I checked everything, generated the code again, checked the database settings in the production enviroment, everything was set up well.

    Then I went into the script of nm_session.phpand found out, the the $dir_prod_conf was set wrong (there was the path element "/_lib" missing.

    So I made a change in the script of nm_session.php and now it is running without a problem.

    YES that is quick and dirty, but for me it is running well and probably the mistake will be away in the following SC version, I am using 8.1.066

    I have no idea why this happens and I don't know, from where the connect() methode was called, because the mistake is right there.

    its is only the from me inserted line 156 with this code: $dir_prod_conf = $conf_dir;

    just inserted line 156

  • #2
    linux? windows?
    Dit you do advanced deployment?
    If linux did you set the proper rights in the dirs? (try with 777)

    In order to set the database connection for the first time you need to create and write rights.
    Teh .../_lib/conf/ needs to be writeable when you set things up for deployment.
    Last edited by rr; 03-30-2017, 08:31 AM.


    • #3
      Hi rr,
      the production system is a linux system.
      I made the standard deployment and also the advanced deployment with no difference.

      The directory/file access rights were set right and the _lib/conf/ directory was writeable.

      I even deleted the configuration file and set it up new with the production setup.

      The problem happend with all forms, grids and apps form Scriptcase inside this project.

      The problem was that wrong path.

      Inside of prod/lib/php/nm_session.php before line 156

      $conf_dir was /path2webserverDir/scriptcase/_lib/conf
      $dir_prod_conf was /path2webserverDir/scriptcase/conf

      here are the originals from my debug session:

      [conf_dir] => /path2webserverDir/scriptcase/_lib/conf
      [dir_prod_conf] => /path2webserverDir/scriptcase/conf
      [prod_ini_file] => /path2webserverDir/scriptcase/conf/prod.config.php

      I have other sites running SC without any problems.
      Only the last two sites have this problem, set up with the newst release of SC. Frederic Espitalier
      Last edited by espi; 03-30-2017, 11:40 AM.