Questions tagged [pdo]

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

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

Official manual

79 questions
3
votes
1 answer

PDO_mysql for mac

Has anybody gotten PDO_mysql working on the default PHP installation on a mac? It works with MAMP but that's inconvenient. I'm developing for Zend Framework and mysql, and Zend_db uses PDO. The default php doesn't come with PDO_mysql.
GoatRider
  • 201
  • 3
  • 8
2
votes
1 answer

How to install PostgreSQL extension for PDO in Linux?

I have the VPS. I can build my PHP version using Easy Apache. I can find the option for PDO support for MySQL, SQLite. But I don't have any option of PDO pgsql driver. How can I enable that? It says that PECL can load other drivers but how can I…
John
2
votes
2 answers

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 about SSL support…
thebarless
  • 123
  • 6
2
votes
2 answers

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 pdo_sqlite I already included following in…
2
votes
1 answer

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 server name) The database name is MyDatabase The…
B1NARY
  • 41
  • 1
  • 5
2
votes
1 answer

Enable php pdo on cpanel

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()-- --enable-pdo=shared' ' Have access to whm but…
mike
  • 21
  • 1
  • 2
2
votes
1 answer

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() works, too. However, when I try to connect to the…
CookieEater
  • 141
  • 5
2
votes
0 answers

phpinfo reports no value for PDO MySQL driver

As per the title I'm having problems with PHP 5.2.10 and getting PDO MySQL to be recognised. My configure command contains '--enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr'…
creativenode
2
votes
1 answer

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
facha
  • 1,298
  • 2
  • 16
  • 26
2
votes
2 answers

Why do I get a PHP 5.2.6 segmentation fault when using PDO_SQlite?

This is an installation on ModWest's shared hosting. I have enabled both PDO and PDO_sqlite on the server and phpinfo() verifies both are running. When I access PDO itself, I'm fine, and getting a meaningful error.
danieltalsky
  • 131
  • 5
1
vote
0 answers

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 few minutes. For example, Last time my script…
undone
  • 167
  • 1
  • 1
  • 7
1
vote
1 answer

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 every 30 minutes. Around 2am UTC it takes about…
Asa Carter
  • 239
  • 1
  • 3
  • 14
1
vote
1 answer

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-pdo Package php-pdo is a virtual package provided…
user761076
  • 199
  • 1
  • 1
  • 10
1
vote
2 answers

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 { $db = new PDO($dsn, $user, $password); …
1
vote
1 answer

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 in InnoDB NOTE: This is a test DB. I also have…
Devang Mistry
  • 115
  • 1
  • 7