I am having trouble setting up PHP with my apache server on my windows machine. It gives me an error when I test the configuration saying that "Cannot load C:/php5/php5apache2.dll into server: The specified module cannot be found". I added (to the httpd file in the conf folder):

LoadModule php5_module "C:\php5\php5apache2.dll"
AddType application/x-httpd-php .php .php3 .phps
PHPIniDir "C:/php5/"
AddHandler server-parsed .shtml .html .htm .php
DirectoryIndex index.html index.htm index.php index.html.var

First off, I don't even know if I put these in the right location. The php files are all in c:/php5/, so I don't know why it can't find it, if that is even how you're suppose to do it.
I attached the actual httpd file as a text document for anyone who wants to see how everything is configured on the file. Also, everything was working fine with regular html file when I first configured my apache.

Thanks

Watch for backslashes in path when using Windows. You should use forward slashes like you did for PhpIniDir.

I am having trouble setting up PHP with my apache server on my windows machine. It gives me an error when I test the configuration saying that "Cannot load C:/php5/php5apache2.dll into server: The specified module cannot be found". I added (to the httpd file in the conf folder):

LoadModule php5_module "C:\php5\php5apache2.dll"
AddType application/x-httpd-php .php .php3 .phps
PHPIniDir "C:/php5/"
AddHandler server-parsed .shtml .html .htm .php
DirectoryIndex index.html index.htm index.php index.html.var

First off, I don't even know if I put these in the right location. The php files are all in c:/php5/, so I don't know why it can't find it, if that is even how you're suppose to do it.
I attached the actual httpd file as a text document for anyone who wants to see how everything is configured on the file. Also, everything was working fine with regular html file when I first configured my apache.

Thanks

I actually tried it both ways and the same error message arose, but yeah i'll change it back to the forward ones.

Ok, from your ServerRoot variable in httpd.conf, you are using Apache 2.2. It doesn't appear that Apache 2.2 and PHP5 are compatible unless you jump through some hoops. If you want something set up quick, looks like it might be easier to downgrade Apache to 2.0.58.

See these sites:
http://www.phpfreaks.com/forums/index.php?showtopic=93309
http://iamcode.net:64//projects/apache/php-win

Good luck.

I actually tried it both ways and the same error message arose, but yeah i'll change it back to the forward ones.

Thanks for the advice. I also found a nice package on sourceforge called wampserver, it has mysql, apache, and php and sets it up for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.