Questions tagged [pdo]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
363 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....
ipegasus's user avatar
  • 111
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 ...
Charlie's user avatar
  • 19
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 ...
dsaj34v's user avatar
0 votes
1 answer
373 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 ...
anhimu's user avatar
  • 1
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 ...
Mike Willis's user avatar
1 vote
0 answers
393 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 ...
undone's user avatar
  • 177
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 ...
Asa Carter's user avatar
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-...
user761076's user avatar
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 { ...
parth's user avatar
  • 111
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 ...
HumanJHawkins's user avatar
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 ...
Raheel Aslam's user avatar
0 votes
0 answers
613 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: ...
FlashL's user avatar
  • 11
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 ...
agent provocateur's user avatar
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 ...
Devang Mistry's user avatar
1 vote
1 answer
285 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 ...
Pete_1's user avatar
  • 111
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 ...
Sebastian's user avatar
  • 123
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 ...
thebarless's user avatar
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 ...
Navid Langaroudi's user avatar
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 ...
sudo's user avatar
  • 11
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 ...
michele's user avatar
  • 101
0 votes
0 answers
442 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 ...
user297670's user avatar
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 ...
starchx's user avatar
  • 533
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: ...
jonathan's user avatar
  • 111
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 ...
nobrandheroes's user avatar
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/...
GIRI's user avatar
  • 151
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 '...
Andreas Wagner's user avatar
0 votes
1 answer
556 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 ...
user3792199's user avatar
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 ...
Rayhan Muktader's user avatar
-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 ...
karan's user avatar
  • 13
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 ...
Zamicol's user avatar
  • 191
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 -------------------------------------------------- [--] ...
koubic's user avatar
  • 131
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 ...
DatsunBing's user avatar
-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 ‘...
Chad's user avatar
  • 11
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/...
Mog's user avatar
  • 155
0 votes
1 answer
783 views

Error installing php-mysqlnd

I've been trying to install phpmysqlnd, but I'm not sure what's going wrong. This is on a CentOS system. I run the commands: yum remove php-mysql yum install php-mysqlnd The first one is a ...
Zero Wing's user avatar
  • 251
0 votes
1 answer
547 views

Activating Informix variables on Apache2/Debian

I'm working on adding PDO for Informix on my Debian server. I have a strong set of instructions from a gentleman who has set this up to run on suse, I'm trying to figure out how to add these ...
Kimomaru's user avatar
  • 101
2 votes
1 answer
2k views

DBLIB PDO driver keeps failing when trying to connect/query Microsoft Azure SQL database

So I'm using Linux (ubuntu) and I'm trying to connect to a Microsoft Azure SQL database. Server information: The server address is a1a1a1a1a1.database.windows.net (a1a1a1a1a1 is a placeholder for my ...
B1NARY's user avatar
  • 51
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()-- ...
mike's user avatar
  • 21
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 ...
Zamicol's user avatar
  • 191
2 votes
1 answer
2k views

PHP: Can't access to MySQL server on a different server via PDO

I'm trying to connect to a offloaded SQL server offered here. It says that I should connect using the internal IP 172.16.0.51. I installed nginx and PHP (php5-fpm, php5-mysql) on my VPS. phpinfo() ...
CookieEater's user avatar
-3 votes
2 answers
3k views

Can't install PHP PDO [closed]

I have now tried to install PHP PDO in 2 hours without any luck, and i have searched everywhere to get a solution - but without any luck. yum install php-pdo doesn't work and i cannot find ...
kim larsen's user avatar
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....
Shahar Galukman's user avatar
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 ...
crashmaxed's user avatar
0 votes
1 answer
439 views

Enable PDO in shared server

My newest client has decided (against my heavy recommendation to use my tried and true host..) to use Webmasters.com to host their site. This is turning into a nightmare... I finally got the full ...
Casey Hodge's user avatar
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 ...
Shawn Welch's user avatar
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 ...
hvalner's user avatar
  • 51
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 ...
MaxPowers's user avatar
  • 171
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 ...
wmarbut's user avatar
  • 301
0 votes
1 answer
10k views

PHP Fatal error: Class 'PDO' not found

PHP Fatal error: Class 'PDO' not found in /home/bd/public_html/app/webroot/Cake/Model/Datasource/Database/Mysql.php on line 177 PHP INFO: PDO PDO support => enabled PDO drivers => sqlite, ...
Tiffany Walker's user avatar
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: ...
Will's user avatar
  • 211