Load Module error

I am having a hard time installing Apache

Syntax error on line 535 of C:/Apache24/conf/httpd.conf: LoadModule takes two arguments, a module name and the name of a shared object file to load it from

How can I resolve the issue?

You could edit the file /Apache24/conf/httpd.conf
And fix the line 535. You could post it here if you’re not sure what’s wrong with it.

After that you need to restart apache.

1 Like

Thank you for your kind response. Im a newbee in Apache. which line is 535?

This is what i included at the end of my httpd.conf

LoadModule php 5_module "C:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"

Quite possibly one of those you added. Which editor are you using? Depending it might support line numbering but you’ll have to enable it.

By looking at those lines not sure what’s the problem but will check my config once i get a chance.

You could rule possibilities out by commenting a line with # and restart apache and see if it runs

They look similar to the end of my conf file. My guess is PHPIniDir needs to come first so AddHandler knows where it is?

PHPIniDir "C:/PHP"
LoadModule php7_module "C:/php/php7apache2_4.dll"
# AddModule mod_php7.c
AddType application/x-httpd-php .php .phar

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

* Note, I commented out mod_php7.c but left it there so I wouldn’t need to remember in case I ever needed it, mine is AddType not AddHandler and you probablay don’t want phar or phps unless you plan on doing that kind of thing.

BTW, you shpuld consider upgrading your PHP version from 5, version 7 has been out for a while now.

im just using notepad. I tried to put # to

#LoadModule php 5_module "C:/php/php5apache2_4.dll"
AddHandler application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"

then message box appears but none happens after clicking accept.

Im newbie in programming and just wanted to self study. This is my first time installing php. Is it okay if Im gonna use 5 and use the one you gave me ?

What do you mean by “nothing happens”? Something must be happening.

This is what i get when I tried

Syntax error on line 536 of C:/Apache24/conf/httpd.conf:
Invalid command ‘PHPIniDir’, perhaps misspelled or defined by a module not included in the server configuration

# configure the path to php.ini
PHPIniDir "C:/php"
LoadModule php 5_module "C:/php/php5apache2_4.dll"
Addtype application/x-httpd-php .php

Well, as you’re just starting I think it’s a bit foolish to learn in an enviroment that is in it’s last days, but that’s up to you.

You may need to open notepad by “right click, run as admin” and after you make changes you’ll need to restart the server

i tried starting apache and this is what happened

php-7.2.4-Win32-VC15-x64 (1).zip
VC15 x64 Thread Safe (2018-Mar-28 20:47:30)

I downloaded v7 now :slight_smile:

1 Like

I have only two guesses.

You still had the conf file open in your editor
Your conf file is still broken somehow

You’ll be glad you did. version 5.6 is getting only security updates and even those will stop Jan 1 2019
http://php.net/supported-versions.php

2 Likes

It is now working. I’ve used PHP 7 and apache 7. Thank you so much!

3 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.