skip to Main Content

I am new apache and php. I installed Apache server in C drive, C:Apache24. then I installed the services in CMD using this command
httpd -k install. then I go to Windows Service. I can start and stop Apache2.4, it is working fine. I want to run php project. Now I installed php in C:php7.

PHP version:

PHP 7.3.0RC3 (cli) (built: Oct 10 2018 01:23:45) ( NTS MSVC15 (Visual C++ 2017) x64 ),
Copyright (c) 1997-2018, The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

Then I open Apache httpd.conf file (C:/Apache24/conf/httpd.conf).

PHPIniDir "C:/php7"
AddHandler application/x-httpd-php .php
LoadModule php7_module "C:/php7/php7apache2_4.dll"  [this is line no 550]

I added the above line in httpd.conf. Then start Apache with this command httpd -k start or another I can start it in Windows Services.

Thus, I am getting this error. Why I do not know.

C:Apache24bin>httpd -k start
httpd: Syntax error on line 550 of C:/Apache24/conf/httpd.conf: Cannot load c:/php7/php7apache2.dll into server: The specified module could not be found.

3

Answers


  1. Chosen as BEST ANSWER

    I figured it out myself. I installed thread safe version. Please do not install non thread safe version.

    The thread safe version is VC15 x64 Thread Safe (2018-Oct-10 19:19:47)

    I added this line in Apache httpd.conf file.

    AddHandler application/x-httpd-php .php 
    AddType application/x-httpd-php .php .html 
    LoadModule php7_module "c:/php730rc3/php7apache2_4.dll" 
    PHPIniDir "c:/php730rc3"
    

  2. I got this error too, after confirming this module exist in /modules/, I checked the httpd.conf and found that the SRVROOT was wrong.

    Define SRVROOT "D:/Project/Apache24/bin"   //wrong
    Define SRVROOT "D:/Project/Apache24"      //correct
    
    Login or Signup to reply.
  3. You must have access cmd like administrator. I supposed that you have changed also httpd.conf and you have modify ${SRVROOT}.. with C:/localhost ( you must have folder localhost in C). ANd install thread safe version

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search