SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unable to load PHP extensions with Apache under Windows

    Upon startup of a localhost Apache HTTPD 2.2.11 under Windows XP Pro SP 3 and with PHP 5.2.10, in the Apache error.log I'm getting a warning message of the form...
    Code:
    PHP Warning:  PHP Startup: Unable to load dynamic library
    'D:\\Server\\PHP\\ext\\xxxxx.dll' - The specified procedure 
    could not be found.\r\n in Unknown on line 0
    ...for each of: php_bz2.dll, php_pdo, php_pdo_mysql, php_xmlrpc.

    I do not get any such warning for the several other PHP extensions that are loaded, such as mysqli.dll.

    Each of the corresponding extensions was installed with PHP, and the dll's are in my PHP\ext directory; php.ini of course includes the corresponding extension=... statements.

    Of course, php.ini of course includes:
    Code:
    extension_dir="D:\Server\PHP\ext"
    And httpd.conf includes:
    Code:
    PHPIniDir "D:/Server/PHP/"
    LoadModule php5_module "D:/Server/PHP/php5apache2_2.dll"
    My Windows environment variable path includes D:\Server\PHP\ and D:\Server\PHP\ext at its start.

    I'm running in an administrator account, and there are no permission issues.

    In case it's relevant: I have multiple copies of libeay32.dll and ssleay32.dll in different locations, including a copy of each in D:\Server\Apache2.2\bin AND in D:\Server\PHP. (There is no copy of libeay32.dll in C:\Windows\system32, but there is a copy of ssleay32.dll in C:\Windows\system32\ZoneLabs.)
    In D:\Server\Apache2.2\bin, both libeay32.dll and ssleay32.dll are version 0.9.8.9, whereas in D:\Server\PHP they are both version 0.9.8.11.

    What's wrong?

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Check how many php.ini files you have.

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    Check how many php.ini files you have.
    Except for copies in backups, on partitions different from Windows and the PHP directory, I have the following php.ini's:
    Code:
    D:\Server\PHP      (my PHP folder)
    D:\Network\Network Magic\WebServer\php
    C:\Program Files\Marvell\61xx\php
    The latter two are associated with self-contained Apache servers bundled with applications; the second is never running. In any case, I renamed both those two php.ini's, restarted Apache and Firefox, and got exactly the same warnings as before. So it doesn't look like the problem is multiple php.ini's.

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Sorry, I can't see the problem as long as you restart apache between each of those renames.

    The other way is to use
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    on a page, and look at the readout to see what is not loading and to double check which ini file it boots itself from.

  5. #5
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    Sorry, I can't see the problem as long as you restart apache between each of those renames.

    The other way is to use
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    on a page, and look at the readout to see what is not loading and to double check which ini file it boots itself from.
    Of course I looked at phpinfo output even before posting here. It shows D:\Server\PHP\php.ini -- the one that it should be finding. And as expected it shows as loaded the modules that are not generating any warnings, and as not loaded the modules that do generate the warnings.

  6. #6
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Of course I looked at phpinfo output even before posting here
    Well as you did not explicitly state you had read the output of phpinfo() (I read your post twice) I thought I would mention it as a way of confirming that you did pick up the correct ini file, thus eliminating the multiple ini files doubts I had,

    What about if you remove one of the dlls from the folder you think it is checking, eg mysqli and check whether it loads or not - that way you will eliminate any extension path doubts you have.

  7. #7
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    ...What about if you remove one of the dlls from the folder you think it is checking, eg mysqli and check whether it loads or not - that way you will eliminate any extension path doubts you have.
    OK, I renamed php_mysql.dll and php_mysqli.dll and restarted Apache. Now they don't show up in the phpinfo results. And my scripts to access MySQL databases bomb now.
    So that seems to nail down that there's no problem with the directory containing the dll's.

    (BTW, for checking what files are where, I'm using a free tool I only stumbled upon recently: "Everything". All it does is to search for files and folders, not their contents. And it's incredibly fast.)

  8. #8
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    My httpd.conf has :
    Code:
    LoadModule php5_module /php/php5apache2.dll
    and it does not have this line
    Code:
    PHPIniDir "D:/Server/PHP/"
    Maybe your files are spread over different hard drives, hence the need for quoting?

    I'm sorry but I am running out of ideas here.

  9. #9
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    My httpd.conf has :
    Code:
    LoadModule php5_module /php/php5apache2.dll
    and it does not have this line
    Code:
    PHPIniDir "D:/Server/PHP/"
    Maybe your files are spread over different hard drives, hence the need for quoting?

    I'm sorry but I am running out of ideas here.
    Both lines were, I believe, added to httpd.conf by the PHP installer. And they're consistent with what's shown in the installation instructions appearing at the top of page 19 of Kevin Yank's "Build YOur Own Database Drive Web Site Using PHP and MySQL", 4th edition (SitePoint).

    With Apache 2.2, one wants php5apache2_2.dll in that LoadModule statement. (php5apache2.dll is for Apache 2.0.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •