Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot load php5apache2_2.dll

Tags:

php

apache

cannot load c:/PHP5/php5apache2_2.dll into server I am getting this error while running apache 2.2 on window XP machine

anyone have any idea what could be the problem. I can see there is no php5apache2_2.dll in c:/php5 folder.

like image 817
Harry Avatar asked Nov 24 '11 23:11

Harry


5 Answers

What worked for me was obtaining php5apache2_4.dll-php-5.4-win32.zip from apachelounge and using "php5apache2_4.dll" file from the "PHP 5.4.8" unzipped folder. I had apache 2.3.4 (32-bit) from apachelounge.com and php 5.4.9 (32-bit) from windows.php.net installed on my Win 7 (64-bit).

The dll worked despite 5.4.8 - 5.4.9 mismatch.

The corrsponding changes within "php.ini" and "httpd.conf" are to be maintained acoording to this helpful guide.

Best regards.

like image 51
Nact Avatar answered Nov 12 '22 23:11

Nact


First you must downlaod de .dll file (php5apache2_2.dll) then put it in your extensions directory.

Then edit your php.ini file, find de text:

;extension=php5apache2_2.dll

// and change y to extension=php5apache2_2.dll

if the text is not present put the line yourself. Then restart apache and it should load your extension.

PD: you can see where your extensions directory is located looking for the text "extension_dir" in your php.ini, sometimes looks like: extension_dir = C:\php\extensions

Hope this help you, if not please paste the error here, you can find an error log file in apache/error/error.log or something like that.

like image 36
sandino Avatar answered Nov 12 '22 21:11

sandino


You should download the dll file from PHP distribution package. And see three ways to set up PHP to work with Apache 2.x.

You can configure PHP as Apache handler in <[apache_home]>\conf\httpd.conf as follow:

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddHandler application/x-httpd-php .php
#configure the path to php.ini
PHPIniDir 'C:\php\'

NOTE: To avoid the error while starting apache, the php ini dir path should be in single quotes with backslash. Don't forget to end it with backslash.

like image 36
Nirolivier Razafindrabekoto Avatar answered Nov 12 '22 23:11

Nirolivier Razafindrabekoto


Here is how I got it to GO:

  1. Created the folder C:\Apache
  2. Downloaded and installed http-2.2.22-win32-x86-no-ssl.msi During install, entered localhost as Network Domain and Server Name
  3. From browser, typed in url http://localhost/ and page came up with "It Works" (I do not know if there is a God, but took that as a good sign:)

  4. Created the folder C:\PHP

  5. Downloaded and installed php-5.2.17-Win32-VC6-86.msi
  6. Created a new file in notepad with the following:
  7. Saved it in the Apache/htdocs folder as phpinfo.php
  8. From browser, typed in url http://127.0.0.1/phpinfo.php
    It did not work (i.e. it did not run the .php program file)

  9. Hmm, oh yeah, you have to restart Apache for it to see updates to its own configuration file
    Start, Apache, Control..
    -> generated the error that it could not find C:\Apache\php5apache2_2.dll

  10. Well, I found it in C:\PHP and I copied it to C:\Apache\
    Start, Apache, Control..
    -> generated an error about a problem with the PHPINIDir directive on line 495 of C:/Apache/conf/httpd.conf

  11. Fixed that by editing this line in the above file to

    PHPIniDir "C:/PHP/php.ini"
    
  12. Tried to restart Apache again, run the test file in the browser. Still, it did not work:(

  13. Recalled seeing this before and decided to reboot computer Restarted (or started) the Apache Server

  14. Ran the test file again.. IT WORKED!

Note that in some of the above I may have mixed up some forward and back slashes Good luck!

like image 2
Rob Avatar answered Nov 12 '22 23:11

Rob


You are getting an error due to the fact that the c:/PHP5/php5apache2_2.dll is not shipped with the non-thread safe version of PHP that you probably downloaded. Two options:

  • Download and install the thread safe version of PHP instead and you will get everything you need.

  • If the non-thread safe version is important to what you want to accomplish, download the zip bundle of the thread safe version and take only the .dll you need from there.

Which version: For Apache Server 2.2, you need to download PHP 5.4 thread safe, which is shipped with both php5apache2_2.dll and php5apache2_4.dll. Some earlier versions probably work as well. PHP 5.5 is only shipped with php5apache2_4.dll which will mismatch with your version.

Cf the download links here on the official site: http://windows.php.net/download/.

like image 2
Darkane Avatar answered Nov 12 '22 21:11

Darkane