In this tutorial I'm using php7 (thread safe) as well as apache24 version
please make sure you've unzipped the files In the place you prefer before we start.
or simply check my previous tutorials at the end of this tutorial.
make sure you've stoppded/uninstalled the service before start.
do the following commands in the command prompt window (cmd.exe) as administrator
cd C:\Apache24\bin
Hit Enter, Then
httpd.exe -k stop
Hit Enter. That's it.
Open the Apache Configuration file C:\Apache24\conf\httpd.conf
After all modules add this:
LoadModule php7_module C:/php7/php7apache2_4.dll
<IfModule php7_module>
AddHandler application/x-httpd-php .php
PHPIniDir "C:/php7"
</IfModule>
Add this inside ifModule php7_module
also you can add different formats or more than one file name.
DirectoryIndex index.html index.php
LoadModule php7_module C:/php7/php7apache2_4.dll
<IfModule php7_module>
DirectoryIndex index.html default.php index.php
AddHandler application/x-httpd-php .php
PHPIniDir "C:/php7"
</IfModule>
Then. Make sure you've added it after all modules
Save the file then close it.
First rename the file C:\php7\php.ini-development to C:\php7\php.ini. It’s a good idea to make a backup of this file as well.
Edit C:\php7\php.ini
;extension=php_mysqli.dll
;extension=php_mbstring.dll
;extension=php_pdo_mysql.dll
just uncomment it. by removing ; then it will be enabled.
Save the file then close it.
Create the following php file C:\Apache24\htdocs\phpinfo.php
<?php
phpinfo();
?>
You have to start Apache Windows service, to do this, use Apache monitor C:\Apache24\bin\ApacheMonitor.exe
`
The other alternative is to open the command prompt window (cmd.exe) as administrator and execute:
if the service isn't installed:
httpd.exe -k install
to start the service:
httpd.exe -k start
to stop the the service
httpd.exe -k stop
Then browse to:
http://localhost/phpinfo.php
to make sure everything is okay!
If you have any problem when starting Apache because of its configuration, you can see the detailed error by executing:
cd C:\Apache24\bin
Hit Enter, Then
httpd.exe -t
Enter.
The -t parameter test the syntax of the configuration files, and then exits.
You can find the specification of the others parameters here.
also make sure you've installed:
Visual C++ Redistributable for Visual Studio 2012
Visual C++ Redistributable for Visual Studio 2017
To avoid any errors like MSVCR110.dll, MSVCR140.dll