Php as Apache plug-in installation

Hi everybody,
I am rather shy to write in such skilled community. I checked everything before decide posting.
I refer to page 19 of Kevin book "Database driven Website using php and Myseql.
and to the three lines on top of the page to be added at the very end of the httpd.conf file.
This is the situation now about such three lines added:

#LoadModule php5_module “H:/Programmi/PHP/php5apache2_2.dll”
AddType application/x-httpd-php .php
#PHPIniDir “H:/Programmi/PHP”

The reason why I have void with # the first and the third line is that:

  • with # on the two lines, Apache starts and runs nicely, even if no php notice results in the bottom of the monitor window. Evidently no php plug-in association to Apache has been achieved;
  • if one (either) of the # sign is eliminated, or both, Apache start up declares an error. Looking at the error log file, results a syntax error referred to the first of the three lines above.

I have accurately checked the paths. The php5apache2_2.dll file is actually present in the directory “H:/Programmi/PHP”. The operating system is Windows XP.
Anybody will help me?
Thank you in advance.

PS: The word “Programmi” obviously means “Programs”. I am Italian and live in Rom.

giulio,

Welcome to SitePoint’s Apache forum!

To use PHP, you MUST tell Apache where the necessary file (PHP) is located. Because it is a combination of the PHPIniDir and the module identification (the dll), you MUST include both.

Finally, please be assured that your English is far better than my Italian (which is non-existent). Actually, you’ve done very well (better than a lot of native English speakers) so you have no reason to be embarrassed.

Regards,

DK

Hy David,
I’m back late sorry for that.
I understood the reason why the three last lines in the httpd.con file are needed, as indicated in my first post, but my problem is that if I activate them eliminating the # sign, an error occours, and if I keep them, Apache does not recognize php as a plug in.
I am stuck.
Any soggestion?
Giulio

giulio,

Sorry for my absence.

Try:

PHPIniDir "H:/Programmi/PHP"
LoadModule php5_module "H:/Programmi/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php

That’s assuming, of course, that your H: drive is where PHP is located under the Programmi directory, that you’re using Apache 2.2.x and that you’re using PHP 5.

Regards,

DK

David,
many thanks for your suggestion.
I will try it and I’ll be back in a couple days,
thank you again,
Giulio