Discussion:
[PHP-INSTALL] php_pdo 5.2 Drupal 7 OpenBSD 5.1
Jim Barchuk
2012-08-18 19:38:04 UTC
Permalink
Hi All!

Simplest Q, is there a way to test (via CLI or a short script) whether
pdo-mysql is -truly- installed and functional?

I'm using OpenBSD 5.1 but want to use a few newer versions of some
software. For example OBSD provides phpMyAdmin 3.4.9 but with a few
oddities I have manually installed 3.5.2.2.

My issue is with Drupal 7. (OBSD provides 6.24.)

The Drupal install fails with:

Requirements problem
Database support Disabled
Your web server does not appear to support any common PDO database
extensions. Check with your hosting provider to see if they support PDO
(PHP Data Objects) and offer any databases that Drupal supports.

There's a link in that text that points to
http://drupal.org/node/270#database which says "Drupal 7 notes... PHP Data
Objects (PDO) must be activated for Drupal 7 to install and run correctly.
Look in your php.ini. Uncomment (remove the leading semicolon) at line
extension=php_pdo.dll, extension=php_pdo_mysql.dll. In Linux, these would
be extension=pdo.so and extension=pdo_mysql.so. Some Linux distributions
may have these extensions by default in files found in the conf.d folder
(Ubuntu 12.04: /etc/php5/conf.d has pdo.ini and pdo_mysql.ini). If these
lines are not there, you will need to add them."

So I added those lines, and httpd restart returns "PHP Warning: PHP
Startup: Unable to load dynamic library
'/usr/local/lib/php-5.2/modules;/usr/local/share/php-5.2/include/ext/pdo/pdo.so'
- File not found in Unknown on line 0" which makes sense because I don't
find a pdo.so anywhere.

On the plus side phpinfo.php reports...
PHP Version 5.2.17 Configure Command
--with-pdo-mysql=shared,/usr/local

...so I don't think I should even -need- the explicit 'extension' line if
it's already --with'ed into the original configure.

I don't know if an OBSD pkg install of Drupal (6) would install the *.so,
and/or perform other PHP configuration adjustments.

I don't know exactly how the Drupal install is looking for the pdo - the
configure says it is, but I can't find it in an extension file. If there
-is- no extension file then I don't know if the Drupal install fail is
caused by simply not finding a file, or trying and failing to run an
actual functional test.

My intent is to find out if the pdo facility is installed at all. If it is
then I'll look into why the Drupal install can't find it.

Thanks much. Have a :) day!

jb
--
Jim Barchuk
***@jbarchuk.coma
Keith Roberts
2012-08-18 20:38:59 UTC
Permalink
Subject: [PHP-INSTALL] php_pdo 5.2 Drupal 7 OpenBSD 5.1
Hi All!
Simplest Q, is there a way to test (via CLI or a short script) whether
pdo-mysql is -truly- installed and functional?
I'm using OpenBSD 5.1 but want to use a few newer versions of some software.
For example OBSD provides phpMyAdmin 3.4.9 but with a few oddities I have
manually installed 3.5.2.2.
My issue is with Drupal 7. (OBSD provides 6.24.)
Requirements problem
Database support Disabled
Your web server does not appear to support any common PDO database
extensions. Check with your hosting provider to see if they support PDO (PHP
Data Objects) and offer any databases that Drupal supports.
Take a look at this link here please:

http://www.php-debuggers.net/

You could try using the SQLite3 database option for testing
purposes first. Check if that's enabled in the output from
phpinfo() as well please.

Should be compiled in as a static module.
There's a link in that text that points to
http://drupal.org/node/270#database which says "Drupal 7 notes... PHP Data
Objects (PDO) must be activated for Drupal 7 to install and run correctly.
Look in your php.ini. Uncomment (remove the leading semicolon) at line
extension=php_pdo.dll, extension=php_pdo_mysql.dll.
In Linux, these would be
extension=pdo.so and extension=pdo_mysql.so. Some Linux distributions may
have these extensions by default in files found in the conf.d folder (Ubuntu
12.04: /etc/php5/conf.d has pdo.ini and pdo_mysql.ini). If these lines are
not there, you will need to add them."
Unable to load dynamic library
'/usr/local/lib/php-5.2/modules;/usr/local/share/php-5.2/include/ext/pdo/pdo.so'
- File not found in Unknown on line 0" which makes sense because I don't find
a pdo.so anywhere.
On the plus side phpinfo.php reports...
PHP Version 5.2.17 Configure Command
--with-pdo-mysql=shared,/usr/local
That's saying it has been put in that location as a shared
PHP loadable module.

You need to add this path into your php.ini file so PHP can
find the pdo.so
...so I don't think I should even -need- the explicit 'extension' line if
it's already --with'ed into the original configure.
I don't know if an OBSD pkg install of Drupal (6) would install the *.so,
and/or perform other PHP configuration adjustments.
Yes - please see above
I don't know exactly how the Drupal install is looking for the pdo - the
configure says it is, but I can't find it in an extension file. If there -is-
no extension file then I don't know if the Drupal install fail is caused by
simply not finding a file, or trying and failing to run an actual functional
test.
PHP is complaining and passing the error back to Drupal, as
drupal is obviously a program written in PHP :)


-----------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------
Rasmus Lerdorf
2012-08-18 21:41:52 UTC
Permalink
Post by Jim Barchuk
My intent is to find out if the pdo facility is installed at all. If it
is then I'll look into why the Drupal install can't find it.
php -m | grep pdo

Loading...