Ad

How To Troubleshoot PDOException?

- 1 answer

I am developing a Laravel application that is talking to a Microsoft SQL server. Everything works, but when I run composer update to update packages I receive the following error:

[PDOException]
could not find driver

Script php artisan clear-compiled handling the pre-update-cmd event returned with an error

[RuntimeException]
Error Output:

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--] [<packages>]...

The strange thing is that the sqlserv driver set up in my database.php file works fine; my vagrant box has the correct driver installed and configured and, as far as I can tell, everything regarding the database connection is working as expected.

What steps can I take to try to narrow down the source of this error?

Update:

I did mention that my SQL connection is, as far as I know, configured correctly on the server: it works for querying, updating, etc. But just in case I missed something here are the full steps I took to install the SQL driver:

  • sudo apt-get install php5-mssql php5-sybase
  • sudo php5enmod mssql
  • sudo nano /etc/freetds/freetds.conf:

    [global]
        tds version = 8.0
        client charset = UTF-8
    
  • sudo service apache2 restart

Ad

Answer

I was finally able to solve this by doing the following:

  • Revert PHP 5.6 to PHP 5.5
  • Run composer update on the actual vagrant vm via ssh
Ad
source: stackoverflow.com
Ad