logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PDO drivers not loading in PHP 5.4.0
Author
pavlepredic



Joined: 16 Mar 2012
Posts: 6

PostPosted: Fri 16 Mar '12 15:14    Post subject: PDO drivers not loading in PHP 5.4.0 Reply with quote

Hi all,

I downloaded the latest windows build from http://windows.php.net/downloads/releases/php-5.4.0-Win32-VC9-x86.zip
but I can't make the PDO drivers to load. I have uncommented the appropriate lines in php.ini (extension=php_pdo_mysql.dll)
but no luck. When running phpinfo(), under section PDO I get:

PDO drivers no value

I'm using apache 2.2.22 Win32 that I downloaded from http://www.apachelounge.com/download/

PHP version 5.3.8 works fine with the same apache install.
OS is Windows 7.

Thanks,
Pavle.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 21 Mar '12 15:11    Post subject: Reply with quote

In your php.ini change

display_startup_errors to On

try to run php from the command line

C:\path\to\php.exe -m
Back to top
pavlepredic



Joined: 16 Mar 2012
Posts: 6

PostPosted: Wed 21 Mar '12 18:54    Post subject: Reply with quote

James,
Thanks for your help. Running php -m did produce some errors, which I managed to fix by commenting out apc and pdo_oci extensions. However, phpinfo() still refuses to display PDO modules. Here's the output from php -m:
Code:
[PHP Modules]
bcmath
bz2
calendar
com_dotnet
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
odbc
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
Reflection
session
SimpleXML
soap
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 21 Mar '12 20:52    Post subject: Reply with quote

Quote:

PDO
pdo_mysql
pdo_sqlite


Aha! Since your php -m shows pdo I guess you might don't load the right php.ini in your apache. Is the phpinfo show the right path to your wanted php.ini ? it not did you set PHPIniDir in your httpd.conf ?
Back to top
pavlepredic



Joined: 16 Mar 2012
Posts: 6

PostPosted: Thu 22 Mar '12 12:55    Post subject: Reply with quote

Thanks again for your help. However, I am loading the correct ini file, and phpinfo() confirms that:

Loaded Configuration File E:\bin\php5.4.0\php.ini

The above path is definitely correct in my setup, and it is the same path used by CLI version of PHP:

Code:
C:\Users\pavle>E:\bin\php5.4.0\php.exe -i | FINDSTR Configuration
Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => E:\bin\php5.4.0\php.ini


And once again, here are the modules shown when running php -m on the same php executable:

Code:
C:\Users\pavle>E:\bin\php5.4.0\php.exe -m | FINDSTR /i pdo
PDO
pdo_mysql
pdo_sqlite
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 22 Mar '12 16:45    Post subject: Reply with quote

I don't know if that phpinfo script is buggy in this case. Hm. You might try a script that shows all loaded extensions.

Code:

<?php
print_r(get_loaded_extensions());
?>



by the way, did you try to run a simple mysql pdo script on the server yet?
Back to top
pavlepredic



Joined: 16 Mar 2012
Posts: 6

PostPosted: Fri 23 Mar '12 18:29    Post subject: Reply with quote

My bad. What happened was that I installed the new version of PHP to a new directory, but forgot to add that directory to Windows path (as described here). This resulted in mysql drivers not being loaded (so not at all a PDO issue). Everything works fine now. Thanks for the help.
Back to top


Reply to topic   Topic: PDO drivers not loading in PHP 5.4.0 View previous topic :: View next topic
Post new topic   Forum Index -> Other Software