Questions tagged [pdo]

PHP Data Objects (PDO) defines a lightweight and consistent interface for accessing databases.

Filter by
Sorted by
Tagged with
0 votes
1 answer
4k views

Let php PDO work with newest version of PostgreSQL (Debian/Ubuntu)

I installed PostgreSQL and the php PDO driver on my 14.04 Ubuntu like this: sudo apt-get install postgresql postgresql-contrib sudo apt-get install php5-pgsql Which installed PostgreSQL 9.3 and ...
4 votes
3 answers
9k views

Linux : Undefined symbol: php_pdo_register_driver in Unknown on line 0

When i add the extenstion extension=pdo_sqlsrv.so in php.ini file in linux server with PHP v7.0 it's giving following error undefined symbol: php_pdo_register_driver in Unknown on line 0 Please ...
2 votes
3 answers
7k views

pdo_mysql is installed but missing in phpinfo

I have a CentOs 6.7 server. I have problem to make pdo_mysql available on apache2. following shows for Command line: myserver$ php -m PDO, pdo_mysql, pdo_sqlite but phpinfo(), shows only PDO and ...
1 vote
1 answer
351 views

What might cause a PDO MySQL connection to be terminated?

Summarize the problem My PDO (MySQL) connection is disconnected during execution of the code. The connection is created successfully, but around 0.05% of the time the Error log reports a disconnection....
2 votes
1 answer
2k views

Can't get php+sqlite working

I'm struggling all morning to make php work with an sqlite database. Here is a piece of php code that I try to execute: #less /var/www/html/test.php <?php $db=new PDO("sqlite:/var/www/test....
1 vote
1 answer
2k views

MySQL PDO Too many connections

I have an application that is constantly inserting to a stats table. The average number of open connections is usually about 20 to 22. There is also a processing script in PHP run by a cron that runs ...
9 votes
4 answers
15k views

AWS RDS connection count

I am using AWS RDS with MySQL for a project and have a "large" instance. The documentation is clear on what this means as far as compute resources and RAM goes, but I can't find anything that ...
1 vote
0 answers
2k views

PHP PDO Very Slow on Fetch

I have a problem with a couple of queries running in PDO on PHP connecting to MSSQL server 2019. I have checked the time in SSMS and its fast. I have also added some timers into my code so I can see ...
0 votes
1 answer
4k views

Red Hat 6 connect to MS SQL server 2005 using freetds; pdo_dblib and php

I'm having a problem connecting to my Microsoft SQL Server 2005 from a Red Hat box using freetds. My end goal is to be able to connect using php's PDO, but I don't appear to be able to connect when ...
5 votes
3 answers
86k views

How to get mysql.sock file, mistakenly deleted from "/mysql/tmp/"

I was stuck with a PDO Exception PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in lock_may_be_available() (line 167 of home/../includes/...
0 votes
1 answer
1k views

Enabling PDO for CLI in vagrant box precise64 (Ubuntu server 12.04 LTS)

I have vagrant box (precise64) utilizing Ubuntu server 12.04. I have installed manually (no use of LAMP) on the server the following: MySql server / MySql client - Server version: 5.5.31-0ubuntu0.12....
4 votes
4 answers
33k views

How do I install the pdo_mysql driver on Red Hat Enterprise Linux 6.1?

I have a RHEL box running PHP 5.3.3, which was installed using the binary packages provided by yum. I have installed the php-pdo package: # yum info php-pdo Loaded plugins: product-id, rhnplugin, ...
0 votes
1 answer
76 views

php pdo comment page error [closed]

sorry for my English. My knowledge about the database is very simple. I have to come this code from a Forum. My problem, when anyone writes a comment, it shows on all Website, when I to wish that ...
0 votes
1 answer
372 views

Apache is getting SUSPENDED in MSSQL by another process when doing more than 5-6 queries via PHP PDO resulting in timeout

I will try to be as detailed as possible. Up until now I was only using Stack Overflow and other sites like this but never posting. I was always able to find the answer to my question. But not this ...
0 votes
1 answer
5k views

Yet another PDO could not find driver issue

I've been working for the last two nights to set up my own LEMP server on Amazon ec2. I'm not a server expert so it's been slow going, and the latest error "could not find driver" is given when ...
1 vote
0 answers
388 views

Mysql has gone away error randomly

I have a web application written in php. In this app, I have a script(CLI) which is really heavy. After this script finishes its job, I get "mysql has gone away" error in my normal http request for a ...
39 votes
5 answers
151k views

How do I tell Apache which PHP to use?

I am running Apache2 on a Mac OS X (10.5). I just compiled PHP 5.2.8 and finally got pdo-mysql working (or so I think). This terminal command: php --version is showing 5.2.8 and I have the right ...
0 votes
1 answer
9k views

Unbuntu 14.04 + Nginx + PHP5-FPM + sqlite3 : pdo sqlite could not find driver

phpinfo() says I have SQLite 3.x driver for PDO. php.ini only mentions sqlite like so: [sqlite] ; http://php.net/sqlite.assoc-case ;sqlite.assoc_case = 0 [sqlite3] ;sqlite3.extension_dir = I ...
1 vote
2 answers
3k views

SQLSTATE[HY000] [2002] No such file or directory, google cloud app engine flexible

I am trying to connect cloud sql with google cloud app engine flexible. My code is as bellow: $dsn = getenv('MYSQL_DSN'); $user = getenv('MYSQL_USER'); $password = getenv('MYSQL_PASSWORD'); try { ...
1 vote
1 answer
13k views

Debian 9 stretch with PHP 7.2: unable to install PDO PHP Extension

I have installed PHP 7.2 on a Debian 9 server (a docker container actually) and installed some php modules. But when I get to gd and pdo/mysql apt is unable to find any packages: $apt install php-...
5 votes
3 answers
14k views

PHP 7.2.8 PDO Fails to Connect to MySQL 8.0.12 (GA) in AWS EC2 LEMP Stack

I'm testing a new LEMP webserver built with Ubuntu Server 18.04 LTS, NGINX 1.14, PHP 7.2.8, and MySQL 8.0.12. It is an AWS EC2 instance using the official Canonical AMI. Web and PHP work as intended ...
3 votes
3 answers
3k views

php pdo connection cannot be established, but mysql command line client can

situation as follows: php script on server a, run by user 'web' (nginx + php-fpm) should access mysql on server b via pdo library, but gets SQLSTATE[HY000] [2003] Can't connect to MySQL server on '...
1 vote
1 answer
3k views

Compiling PHP on CentOS Needs MySQL PDO Configured

I am trying to compile PHP with mysql_pdo on CentOS 6 and I am having just one heck of a time trying to make it happen. Currently I am trying to compile PHP 5.2, but I am going to have to do this for ...
0 votes
0 answers
612 views

Fedora26 PHP 7.1.10 PDO_SQLITE Startup Warning: Unable to load dynamic library

php -v responds with : PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64 /php/modules/pdo_sqlite.so' - /usr/lib64/php/modules/pdo_sqlite.so: undefined symbol: ...
0 votes
1 answer
3k views

Trying to install pdo_oci via PECL fails asking for PDO extension

I'm using Linux Mint 11 (based on Ubuntu 11.04) and I need to use PHP with Oracle through PDO, a requirement of the framework we will work with. I've installed various PDO extensions using the normal ...
0 votes
3 answers
2k views

PDO ODBC error just resets connection

Trying to write an ODBC PDO driver for CakePHP. Seems like I get closer and closer however whenever a PDO function is called that it doesn't like the connection just gets reset immediately and I'm not ...
0 votes
1 answer
1k views

PHP PDO oci extension stopped loading

After going through our most recent deployment, pdo_oci stopped loading up with the rest of the php PDO extensions... None of the apache (except for hostname) and php configurations were changed in ...
3 votes
1 answer
12k views

MySQL connections aborted - should I be worried?

I'm tuning MySQL on a webserver with Apache and mod_php for speed so I ran mysqltuner and here's the result: -------- General Statistics -------------------------------------------------- [--] ...
1 vote
2 answers
2k views

Dynamic column enumeration for preventing SQL injection

I have an application which is completely for internal use but I'm trying to make sure I have my bases covered on SQL injection. Unless someone else has some information to point me otherwise there ...
1 vote
1 answer
9k views

Connecting to MySQL is taking a long time

Here is a normal client side sending an AJAX request to the server, without using any libraries. About The Database: There is only 1 table in the DB having 2 columns and 2 rows. The Storage Engine ...
1 vote
1 answer
282 views

MySQL server experiencing high stress/max connections

The Short: We're hitting max connections and seeing very poor performance from MySQL during peak business hours and cannot determine if it is a load problem or a configuration problem. The Long: To ...
2 votes
2 answers
2k views

What are the benefits of connecting to MySQL using PHP-PDO's SSL attribute?

I primarily develop PHP applications using MySQL as my database. Generally, the server running the application is on the same box as the MySQL server, though not always. I was reading in the PHP docs ...
5 votes
2 answers
28k views

Installing PDO_DBLIB for PHP [closed]

I'm trying to get PDO's to work with SQL Server and I'm completely lost. I found this : http://www.php.net/manual/en/ref.pdo-dblib.php http://pecl.php.net/package/PDO_DBLIB and told to try this: ...
5 votes
2 answers
52k views

How enable pdo_mysql

I am trying to install SpaceBukkit. I was wondering how I enable pdo_mysql. When trying to setup the MySQL part I get this error: The "pdo_mysql" extension is NOT loaded in your `php.ini`! Make sure ...
0 votes
1 answer
1k views

PDO to AWS RDS Connection Issue

We have a website written in PHP hosted on AWS EC2 instance, talking to AWS RDS database. When high traffic on the site, some users are experiencing 503 error on pages and we can see these errors on ...
1 vote
1 answer
19k views

Connecting to MSSQL db (PDO, FreeTDS, ODBC)

I have an Ubuntu 12.04 server and I'm trying to establish a connection to a MSSQL database. I've managed to connect using tsql and isql, but osql doesn't work and connecting with PHP using PDO also ...
7 votes
3 answers
8k views

Php pdo_dblib - cannot find/unable to load freetds

Self-hosted box, RHEL 6 PHP 5.3.3 PDO installed freetds installed pdo_dblib - so far no luck installing My goal is to use PDO with sybase. Attempting to install pdo_dblib from the appropriate ...
7 votes
2 answers
31k views

PDO_MYSQL Installation on CentOs6

I have a new CentOS 6 server running PHP 5.3.2. The output of php -v shows Unable to load dynamic library '/usr/lib64/php/modules/pdo_mysql.so - /usr/lib64/php/modules/pdo_mysql.so cannot open ...
0 votes
1 answer
1k views

unable to find driver - lamp debian

This is my php sample script: <?php try{ $db=new PDO('mysql:dbname=_mydb;host=localhost', 'root', 'xxxxxx'); }catch(PDOException $e) { echo "Error: ".$e->getMessage(); } ?> And I ...
0 votes
0 answers
441 views

Upgrade SQLite Library for php 5.4

My php version is 5.4 This is what I get in phpinfo pdo_sqlite PDO Driver for SQLite 3.x enabled SQLite Library 3.6.20 I really need to update this driver. On PHP 5.3 you could do this with ...
1 vote
1 answer
3k views

OpenShift: MySQL PDO 'connection refused', works locally [duplicate]

I have an API i want to deploy to OpenShift, everything works locally, but when trying to use it online i get some problems. When trying to connect to the database, using PDO, i get this error: ...
1 vote
2 answers
2k views

SSL Support for PHP 5.3.3 and Apache

After a solid day investigating why I can't get my application to connect to a remote server over SSL using PHP PDO, I found PDO::MYSQL_ATTR_SSL..., but it seems that they exists only for 5.3.7 or ...
6 votes
4 answers
44k views

How can I install mysql PDO driver in Ubuntu 10.04 and PHP 5.3.2

I tried to install mysql PDO driver with this command: $ sudo pecl install pdo_mysql but I got the following error: WARNING: "pecl/PDO_MYSQL" is deprecated in favor of "channel://http://svn.php.net/...
2 votes
1 answer
10k views

Enable php pdo on cpanel [closed]

Getting this error: Fatal error: Class 'PDO' not found Have these lines in php.ini: extension=pdo.so extension=pdo_sqlite.so extension=sqlite.so extension=pdo_mysql.so This shows up in php.info()-- ...
0 votes
1 answer
553 views

Periodically run an MS SQL query on multiple sites

I have been tasked with pushing Google Analytics data periodically to SQL Server 2005 running on a different server from various websites (about 450 of them) grouped on various servers. I understand I ...
-1 votes
1 answer
986 views

Installing PDO and other PHP extensions for magento

I have a server and i was using php files on it. For some reason i had to reinstall apache on it. My files and my SQL database is still there. Now after fresh installation of Apache, when i run my ...
1 vote
1 answer
2k views

Connecting to SQL Server 2005 via PDO

I've upgraded my php installation to 5.4.14 using Microsoft's Web Platform Installer 4.6. Php is working great except I cannot connect to my database. My connection was working great before the ...
0 votes
1 answer
6k views

How to install new PDO driver to existing LAMP install

How do I install a new PDO driver to an existing LAMP installation? I am using Amazon Linux (on AWS EC2), and have installed PHP 5.5 and MySql from the Amazon repositories. When I look at phpinfo I ...
3 votes
2 answers
4k views

Why are these two PDO classes different (and how can I make them the same)?

I have a web-based PHP email client (Roundcube) that I installed on a UNIX server, and right off the bat it produced this error: Fatal error: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS' in /path/...
-1 votes
1 answer
8k views

how to install pgsql_pdo? [closed]

I need to install pgsql_pdo but getting this error via root@server5 [~]# pecl install pdo_pgsql root/tmp/pear/PDO/pdo_dbh.c:1139: error: ‘zend_internal_function’ has no member named ‘...