6

I have a script which uses __autoload() to load classes (stupid, I know, this is old code I used to use for fun / testing), and it seems to be trying to autoload PDO. This leads me to believe that it's not finding the PDO class it should be. I have checked php.ini and php_pdo.dll is enabled, along with php_pdo_mysql.dll, etc. The .dll files exist in "ext/" and I've restarted the web server numerous times.

I don't have much experience with IIS, but I've never had this issue on Linux, so I'm not sure what the issue is.

Any help would be greatly appreciated.

EDIT: PDO is not in phpinfo(). I know it's not loaded correctly, I'm trying to figure out why. Here is my php.ini file: php.ini on Pasebin

C:\Program Files (x86)\PHP\ext is the extension directory, and listed as such in php.ini and phpinfo().

15
  • Show us the output of phpinfo(). Commented Mar 23, 2011 at 16:19
  • Check phpinfo(). Listing the .dll in the .ini isn't enough to be "sure" it's loaded. If PDO isn't listed in the phpinfo() output, it's not loaded. Commented Mar 23, 2011 at 16:19
  • 1
    @poelinca What does PHPUnit (via pear I assume) have to do with IIS? You know .htaccess is an Apache convention, right? Commented Mar 23, 2011 at 22:44
  • 1
    Installing WampServer or XAMPP is not an option. I run XAMPP on my local laptop, but this is not my server, it's a friend's. He wants to run IIS, not XAMPP. As far as a business environment goes, IIS is preferred over XAMPP or WampServer as far as I know. Commented Mar 23, 2011 at 23:05
  • 1
    @John Rather than go the manual route, you could give Zend Server CE a try. It plays nice with IIS, has a great web UI admin dashboard and works great out of the box Commented Mar 23, 2011 at 23:30

6 Answers 6

4
+50

One thing I find odd is that you are specifying the extension in the [PDO] section. I'm not aware of this kind of notation - my Windows php.ini doesn't do that. It could be that the line gets ignored because it gets interpreted as PDO.extension which doesn't make sense.

What happens if you move the extension=php_pdo.dll bit into the main body of the INI file (outside any [] section)?

If that doesn't change anything: Are you 100000% sure you are editing the correct php.ini?

With the extension specified in the file, PHP should either crash when you restart the server, or give you the PDO class.

Check phpinfo() to see which ini file is being used exactly.

Sign up to request clarification or add additional context in comments.

8 Comments

According to phpinfo(): C:\Program Files (x86)\PHP\php.ini This is what I'm currently editing. I also commented out the [PHP_PDO] and the extensions, and moved them up to the main body, it still didn't work.
@John hmm, really strange. Can you try initializing new PDO(....); in a file that has no autoloading capability? Just to confirm 100% that PDO not loading is the problem?
Fatal error: Class 'PDO' not found in C:\inetpub\robwolff.co.cc\test.php on line 3
@John okay, that is pretty clear. Weird. The last idea I have is to check the windows directory for a php.ini file. Maybe there's some weirdness that causes PHP to use that one, I vaguely remember that being standard behaviour in some situations. Other than that, I really don't know what this could be.
Even though phpinfo() tells me that it's not that php.ini being used?
|
2

I am sure you have done most/all of the following things but here is what I would do:

1 : Look into IIS error log and see if it reports any issues (i havent worked with IIS in a while but i am sure there is an error log file somewhere)

2 : Make sure other .dll files are being loaded by cross checking in phpinfo()

3 : Comment out all the extensions like php_mbstring.dll, gd2 etc and see if that reflects in the phpinfo(), then start enabling one by one.

4 : Delete all the sections at bottom and simply put the extensions in the dynamic extensions section of the ini. something like

extension=php_abc.dll
extension=php_xyz.dll
extension=php_123.dll

5 : I have always been a bit reluctant on having spaces in directory names, so i would copy the ext folder to the root of c somewhere for testing, maybe something like c:\phpexts

6 : I would take the same php.ini and create a similar environment in apache (same php version) and see if it works or conversely port a php.ini from Apache to IIS.

Comments

1

Try opening cmd and typing C:\Program Files (x86)\PHP\bin\php -r "".

Do you get an error message? If yes, what?

Make sure you have the correct extension for the Visual C++ version you're using with IIS.

If no, take that directory and move it to C:\. It might be related to the spaces in the path. Adjust your IIS configuration and try again.

Good luck!

1 Comment

php5ts.dll is missing, and I'm using some Microsoft support thing to try and fix that. If it works, you have my best answer. :)
0

Just had this problem, check the permissions on the dll files, did the trick for me.

1 Comment

They seem to be fine. Full control for SYSTEM and Admins, Read+Execute for Users.
0

We had the same problem just check the variable extension_dir inside [WebPIChanges]

Comments

0

please look at this answer: this answer and in a conclusion you need to install php_sqlsrv_7_nts_x86.dll in your extensions.

you can download it from here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.