PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 24, 2022

[FIXED] How to troubleshoot PDOException?

 January 24, 2022     composer-php, laravel, php, sql-server     No comments   

Issue

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


Solution

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


Answered By - benjivm
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing