prepare environment for running PHP if you only download package which only contain PHP command lines, not PHP package installer. You need to install Visual C++ Redistributable for Visual Studio(one of versions 2010,2012,2013,2015) from https://www.microsoft.com/en-us/download/details.aspx?id=49984
And you must use the same version visuall studio for building PHP and Apache(Because you run PHP as PHP-apache module which is built from PHP):
(PHP 5.6 and Apache 2.4 compiled with VC11)
apache_2.2.14-win32-x86-no_ssl.msi Network Domain: home-vn.com.vn
=> It works!
AddType application/x-httpd-php .php DirectoryIndex index.php index.htm index.html PHPIniDir "C:/Program Files/PHP/" LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
extension_dir = "C:\Program Files (x86)\php-5.4.40\ext" [PHP_MYSQLI] extension=php_mysqli.dll [PHP_PDO_MYSQL] extension=php_pdo_mysql.dll
<?php phpinfo(); ?>
And check by go to http://192.168.1.3/phpinfo.php
LoadModule rewrite_module modules/mod_rewrite.so
ServerRoot "c:/Apache24"
httpd.exe -k install
After install, you can check service name in services.msc and see it. And to uninstall
httpd.exe -k uninstall
httpd.exe
# Virtual hosts Include conf/extra/httpd-vhosts.conf Include conf/vhosts/*.conf
<VirtualHost *:80> DocumentRoot "E:/web/dacsan-opencart" ServerName dacsan.babies.vn DirectoryIndex index.php index.html index.htm <Directory E:/web/dacsan-opencart> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all </Directory> SetEnv APPLICATION_ENV development ErrorLog "logs/dacsan-opencart-error.log" CustomLog "logs/dacsan-opencart-access.log" common </VirtualHost> <VirtualHost *:80> DocumentRoot "E:/web/baotam" ServerName baotam.vn DirectoryIndex index.php index.html index.htm <Directory E:/web/baotam> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all </Directory> SetEnv APPLICATION_ENV development ErrorLog "logs/baotam-error.log" CustomLog "logs/baotam-access.log" common </VirtualHost>
[authz_core:error] client denied by server configuration
⇒ Fix follow tutorial in link: http://httpd.apache.org/docs/2.4/upgrading.html#access.In this example, to config all requests are allowed:
Order allow,deny Allow from all
Require all granted