PDO Exception : Could not find driver. [duplicate] - sql-server-2008

Does the MySQL-server and PHP5-MySQLi version have to match in order for a connection to be possible? I'm currently receiving the error below: I am running BSD.
"Fatal error: Uncaught exception 'PDOException' with message 'could not find driver'..."
Here is the the connection info:
$info = "mysql:dbname=myDB;host=localhost";
$user = "dbUser";
$pw = "somePW";
return(new PDO($info, $user, $pw));
Here is my MySQL information:
mysql-server-5.5.24
php5-mysqli-5.4.3

I had this same issue on my CentOS install. I had tried to install imagick and hosed my install. When I removed all of my php files and reinstalled something wasn't working right.
I ran:
yum install php-pdo
yum install php-pdo_mysql
After doing those two lines I ran
service httpd restart
and everything came back up and running.

PDO uses database specific drivers to connect to database systems. It looks like you are missing the pdo_mysql driver that is required to connect to a MySQL database. There is some details on installing the driver on the pdo_mysql manual page, or there may be a BSD package that you can use (I am afraid I'm not familiar enough with BSD to offer specific advice).

Thanks to zerkms and John C for pointing me in the right direction. Below are the commands I used to install the driver:
#cd /usr/ports/databases/php5-pdo_mysql
#make install clean
#apachectl restart

Related

Error while running "podman run"; error adding pod to CNI network "podman": unexpected end of JSON input

I'm new to podman, and I just trying to run containers on it.
(podman version 3.4.0, installed by brew, intel Core MAC)
However, when I trying to run "podman run {image-name}", below errors were thrown.
$ podman run -ti -d --name web httpd 125
Error: error configuring network namespace for container b0e70d672cb66005833c0a300c8661b88eab49e942c240d69d17587e0b75c47b: error adding pod web_2_web_2 to CNI network "podman": unexpected end of JSON input
$ podman run centos:7
Error: error preparing container a6d0bc1ad217cd8207935561dc8ff7bd33672da3fa513917f9965cb39520c449 for attach: error configuring network namespace for container a6d0bc1ad217cd8207935561dc8ff7bd33672da3fa513917f9965cb39520c449: error adding pod quirky_snyder_quirky_snyder to CNI network "podman": unexpected end of JSON input
By reading https://issueexplorer.com/issue/containers/podman/11452, I removed ~/.docker/, but the solution doesn't work in my case.
Of course, the error message says there was "unexpected end of JSON input", but I don't know how to fix it. Could anyone guess why podman didn't work even running these base images, or how to debug it?
Thanks in advance.
on macos, current machine version 3.3.1 has this problem. I had this problem on server version 3.3.1 and I do not encounter it on server version 3.4.0. You can check server version with podman version.
Try removing current machine and installing a newer one
podman machine stop
podman machine rm
podman machine init --image-path next
podman machine start
Check server version again with podman version.
Try running your image again.

OS X ejabberd configure error: SQLite3 library >= 3.6.19 was not found

I tried to install ejabberd in my local Mac OS X machine, but while configuring sqlite using following command as mentioned in steps. I'm stuck at the following issue.
./configure --prefix=$HOME/my-ejabberd --enable-sqlite
Error received
checking for SQLite3 library >= 3.6.19... yes
cat: /include/sqlite3.h: No such file or directory
./configure: line 4172: test: !=: unary operator expected
configure: WARNING: Cannot find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!
configure: error: SQLite3 library >= 3.6.19 was not found
Steps I followed from - https://docs.ejabberd.im/developer/install-osx/
If you just want to install vanilla Ejabberd then you can simply do brew install ejabberd.
According to the issue, you can also try:
./configure --prefix=$HOME/my-ejabberd --enable-sqlite --with-sqlite3=/usr/local/opt/sqlite
P.S. I have filed the issue on Github Ejabberd.

mariadb odbc throws invalid pointer error

I have MariaDB installed (as part of Fedora installation) on Fedora 21. ODBC is also installed. BUT, when I go to test the ODBC configuration (or when Asterisk attempts to use ODBC) I get an error in free():invalid pointer.
odbcinst.ini
[MySQL]
Description=ODBC for MySQL
Driver=/usr/lib64/libmyodbc5.so
Setup=/usr/lib64/libodbcmyS.so
FileUsage=1
UsageCount=2
odbc.ini
[asterisk]
Description=MySQL connection to 'asterisk' database
Driver=MySQL
Database=asteriskdb
Server=localhost
UserName=<theusername>
Password=<thepassword>
Port=3306
Socket=/var/lib/mysql/mysql.sock
Connecting to the database using mysql works perfectly fine using these credentials. But doing:
echo "select 1"|isql -v asterisk theusername thepassword
results in this:
*** Error in `isql': free(): invalid pointer: 0x00000000011c4e58 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7850e)[0x7fdd0ef7850e]
/lib64/libc.so.6(cfree+0x5b5)[0x7fdd0ef84165]
/usr/lib64/libmyodbc5.so(MySQLGetPrivateProfileStringW+0x132)[0x7fdd083381c2]
/usr/lib64/libmyodbc5.so(ds_lookup+0x5d)[0x7fdd08336c3d]
/usr/lib64/libmyodbc5.so(MySQLConnect+0xbe)[0x7fdd08316a1e]
/lib64/libodbc.so.2(SQLConnect+0x9e5)[0x7fdd0fb41745]
isql[0x402908]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7fdd0ef1ffe0]
isql[0x402c31]
======= Memory map: ========
I can provide the rest of the core dump if it will help anyone.
Any suggestions for what is causing this and how to prevent it? I need ODBC working.
I had the same problem on my F21 86_64.
The resolution for me was to install a newer version (logged in as root):
1 remove actual odbc-version (5.2.2 if I remember well)
yum remove mysql-connector-odbc
2 Searching the newest version of mysql-connector-odbc-5.3.4-1.x86_64.rpm) at:
http://dev.mysql.com/get/Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.4-1.x86_64.rpm (you need to subscribe)
yum localinstall --nogpgcheck mysql-connector-odbc-5.3.4-1.x86_64.rpm
3 symbolic link creation because unixODBC points still to
/usr/lib64/libmyodbc5.so instead of /usr/lib64/libmyodbc5w.so
ln -s /usr/lib64/libmyodbc5w.so /usr/lib64/libmyodbc5.so
4 if needed don't forget to modify (in ~/.odbc.ini)
.....
Driver64=/usr/lib64/libmyodbc5w.so
....
Hope this helps
Roman

Plesk MySQL driver configuration error on CentOS

After manually upgrading PHP and MySQL on my Cent OS box then logging in to my Plesk administration panel, I'm receiving the following error when attempting to carry out numerous tasks. PHP and MySQL are functioning correctly in their own right.
New files of configuration for Apache web server were not built due to errors in configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = [unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc3.so' : /usr/lib64/libmyodbc3.so: cannot open shared object file: No such file or directory. The detailed error message was e-mailed to you, so please check the e-mail, fix the errors, and click here to retry generating broken configuration or click here to retry generating of all configurations.
I have located the ODBC configuration details in the following file:
/etc/odbcinst.ini
The contents of which are as follows:
# Driver from the MyODBC package
# Setup from the unixODBC package
[MySQL]
Description = MySQL driver for Plesk
Driver = /usr/lib64/libmyodbc3.so
Setup =
FileUsage = 1
Driver64 = /usr/lib64/libmyodbc3.so
Setup64 =
UsageCount = 1
I expect that the Driver & Driver64 parameters must be updated to reflect the changes that occurred when MySQL was upgraded however I am unable to locate the path to the appropriate driver and am out of my depth now. Any advice greatly welcomed.
UPDATE: a '# locate libmyodbc3' returns no results.
Turns out the ODBC and mysql-connector-odbc packages were missing.
They were installed using YUM as follows:
# yum install unixODBC
# yum mysql-connector-odbc packages

Error when trying to add subdomain or add databases with cPanel

cPanel is throwing up an error everytime I try to add or edit an existing subdomain. The same error is showing up when I try to add a new database.
Cpanel::AdminBin::_get_cpwrapd_connection could not connect to /usr/local/cpanel/var/cpwrapd.sock
PHPMyAdmin, FTP and SSH are all working perfectly, so the problem is something to do with cPanel. The server is a VPS with GoDaddy. I was installing a program running on Ruby 1.8.7, and this error started showing up after I installed the program. I have tried /scripts/installruby but that's giving me this error:
The internal error was:
(RegexpError) Stack overflow in regexp matcher: /.*((?>\/\*.*?\*\/\s+))
([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(Mongrel)"/mx
ERROR: While generating documentation for mongrel-1.1.5
... MESSAGE: Stack overflow in regexp matcher: /.*((?>\/\*.*?\*\/\s+))
([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(Mongrel)"/mx
... RDOC args: --ri --op /usr/local/rvm/gems/ruby-1.8.7-p374/doc/mongrel-1.1.5/ri --line-numbers --title Mongrel --main README lib ext CHANGELOG COPYING lib/mongrel/camping.rb lib/mongrel/cgi.rb lib/mongrel/command.rb lib/mongrel/configurator.rb lib/mongrel/const.rb lib/mongrel/debug.rb lib/mongrel/gems.rb lib/mongrel/handlers.rb lib/mongrel/header_out.rb lib/mongrel/http_request.rb lib/mongrel/http_response.rb lib/mongrel/init.rb lib/mongrel/rails.rb lib/mongrel/stats.rb lib/mongrel/tcphack.rb lib/mongrel/uri_classifier.rb lib/mongrel.rb LICENSE README --title mongrel-1.1.5 Documentation --quiet
die [installruby] Failed command: /usr/bin/gem install mongrel-1.1.5.gem --local
exit level [die] [pid=5273] (Failed command: /usr/bin/gem install mongrel-1.1.5.gem --local)
I solved the problem by rebooting cPanel, using /etc/init.d/cpanel restart