Jump to content


Photo

PHP Apache Configuration Error

cannot load php5apache2_4.dll

Best Answer requinix, 06 December 2013 - 05:05 AM

The php5apache2_4.dll is for Apache 2.4. You are using Apache 2.2. Go to the full post


  • Please log in to reply
4 replies to this topic

#1 stanjames2009

stanjames2009

    Newbie

  • New Members
  • Pip
  • 3 posts

Posted 06 December 2013 - 04:15 AM

Hello,

 

I am trying to configure PHP with Apache Http Server on my Windows 7 Laptop. 

 

Apache MSI - httpd-2.2.25-win32-x86-no_ssl.msi PHP ZIP - php-5.5.6-Win32-VC11-x86.zip

 

For PHP I did the following

1. Renamed php.ini-development to php.ini 2. In php.ini removed ; (uncommented) in front of extension_dir and given the path for extension_dir as "C:\PHP\ext".  C:\PHP is where my PHP files are unzipped to.

3. In php.ini removed ; in front of extension=php_mysql.dll

 

For Apache in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\httpd.conf made the following changes 1.  Added LoadModule php6_module "C:\PHP\php5apache2_4.dll"

2.  Added

    AddType application/x-httpd-php .php

    AddType application/x-httpd-php-source .phps

    PHPIniDir "C:\PHP"

 

But while trying to restart Apache Service I am getting the error Cannot load C:/PHP/php5apache2_4.dll into server: The specified procedure could not be found.

 

I tried with different versions of PHP zip like php-5.4.22-Win32-VC9-x86.zip and php-5.3.27-Win32-VC9-x86.zip.  But same error.

 

In one of the PHP forums I found that if VC++ redistributable package is installed the error will be solved.  VC++ redistributable package was installed already even then i downloaded again and installed still same error.

 

In othere post it was mentioned that using VC6 of PHP will solve this.  I could not find VC6.

 

I am just begining my adventure with PHP, it would be great if any one can help me with this issue in setting up the environment.

 

 

** Steps which i am following from wrox book mentions to copy libmysql.dl from c:\PHP to c:\Windows\System32 or C:\WINNT\System32.  But I could not find libmysql.dll in any of the versions of zip that I used.

 

Regards,

James



#2 requinix

requinix

    Playful Member

  • Moderators
  • 5,747 posts
  • LocationWA

Posted 06 December 2013 - 05:05 AM   Best Answer

The php5apache2_4.dll is for Apache 2.4. You are using Apache 2.2.

#3 stanjames2009

stanjames2009

    Newbie

  • New Members
  • Pip
  • 3 posts

Posted 06 December 2013 - 06:54 AM

Thank You it worked!!

 

As pointed out I changed  it to LoadModule php5_module "C:\PHP\php5apache2_2.dll" and it worked.

 

Steps which I am following also mentions to copy libmysql.dll from c:\PHP to c:\Windows\System32 or C:\WINNT\System32 for PHP to work with MYSQL.  But I could not find libmysql.dll in c:\php.  I haven't installed MySQL yet.  Will this be a problem while trying to connect to MySQL.

 

Regards,

James



#4 Ch0cu3r

Ch0cu3r

    Advanced Member

  • Moderators
  • 1,716 posts

Posted 06 December 2013 - 07:35 AM

 

Steps which I am following also mentions to copy libmysql.dll from c:\PHP to c:\Windows\System32 or C:\WINNT\System32 for PHP to work with MYSQL.  But I could not find libmysql.dll in c:\php.  I haven't installed MySQL yet.  Will this be a problem while trying to connect to MySQL.

Don't move anything from the PHP install folder. Instead add the install folder to the Windows PATH variable. 

 

Go to Control Panel > System and Security > System >  Advanced System Settings > Environment Variables > Select PATH from System Variables and click Edit. Press the End Key and type in C:\PHP;

Press Ok to all open windows and restart Windows. 

 

PHP should now be able search for libraries within in its own install folder. Just edit the php.ini and enable the required extensions you need to use.

 

Make sure you restart Apache after modifiing the php.ini

 

PHP5.3+ no longer comes with libmysql.dll it is built in to PHP. All you need to do is enable the mysql (or mysqi) extension(s).


Edited by Ch0cu3r, 06 December 2013 - 07:37 AM.


#5 stanjames2009

stanjames2009

    Newbie

  • New Members
  • Pip
  • 3 posts

Posted 06 December 2013 - 08:12 AM

Thanks Ch0cu3r for the valuable tips..






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com