php:php-apache-on-windows
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
php:php-apache-on-windows [2016/05/19 09:22] – [Some errors and fix] admin | php:php-apache-on-windows [2022/10/29 16:15] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 11: | Line 11: | ||
* vs2015 | * vs2015 | ||
==== Basic Steps to install ==== | ==== Basic Steps to install ==== | ||
- | (PHP 5.6 and Apache 2.4) | + | (PHP 5.6 and Apache 2.4 compiled with VC11) |
- | - Step1: Install PHP package for **thread safe** (thread safe version **contain apache2 module**) with extra options | + | - Install Visual C++ Redistributable for Visual Studio 2012(VC11) http:// |
- | - Step2:Install Apache version base on **apache2 module** which contain in PHP package from http:// | + | - Install PHP package for **thread safe** (thread safe version **contain apache2 module**) with extra options |
+ | - Install Apache version base on **apache2 module** which contain in PHP package from http:// | ||
apache_2.2.14-win32-x86-no_ssl.msi | apache_2.2.14-win32-x86-no_ssl.msi | ||
Network Domain: home-vn.com.vn | Network Domain: home-vn.com.vn | ||
</ | </ | ||
- | - Step3: test apache by go to link http:// | + | - Test apache by go to link http:// |
=> It works! | => It works! | ||
</ | </ | ||
- | - Step4: | + | - Change configure of httpd.conf for calling PHP as module< |
AddType application/ | AddType application/ | ||
DirectoryIndex index.php index.htm index.html | DirectoryIndex index.php index.htm index.html | ||
Line 26: | Line 27: | ||
LoadModule php5_module " | LoadModule php5_module " | ||
</ | </ | ||
- | - step5: | + | - Change config of php.ini for loading modules which connecting to MySQL server(**must change extension_dir**):< |
extension_dir = " | extension_dir = " | ||
[PHP_MYSQLI] | [PHP_MYSQLI] | ||
Line 33: | Line 34: | ||
extension=php_pdo_mysql.dll | extension=php_pdo_mysql.dll | ||
</ | </ | ||
- | - Step6: create | + | - Create |
<?php | <?php | ||
phpinfo(); | phpinfo(); | ||
?> | ?> | ||
</ | </ | ||
- | - Step7: | + | - Modify httpd.conf to enable mod rewrite:< |
LoadModule rewrite_module modules/ | LoadModule rewrite_module modules/ | ||
</ | </ | ||
Line 44: | Line 45: | ||
- Step1: Download Apache binary from http:// | - Step1: Download Apache binary from http:// | ||
- Step2: Extract download file to drive C on windows. For example: | - Step2: Extract download file to drive C on windows. For example: | ||
- | - Step3: Change **ServerRoot** config in httpd.conf If you extract Apache binary to another directory:< | + | - Step3: Change **ServerRoot** config in **httpd.conf** If you extract Apache binary to another directory:< |
ServerRoot " | ServerRoot " | ||
</ | </ | ||
Line 51: | Line 52: | ||
</ | </ | ||
httpd.exe -k uninstall | httpd.exe -k uninstall | ||
+ | </ | ||
+ | - Step5: Run to test httpd:< | ||
+ | httpd.exe | ||
</ | </ | ||
==== Config virtual host on Apache ==== | ==== Config virtual host on Apache ==== | ||
Line 56: | Line 60: | ||
# Virtual hosts | # Virtual hosts | ||
Include conf/ | Include conf/ | ||
- | Include conf/extra/home.conf | + | Include conf/vhosts/*.conf |
</ | </ | ||
- | - Step2: create file **conf/extra/ | + | - Step2: create file **conf/vhosts/ |
< | < | ||
DocumentRoot " | DocumentRoot " | ||
Line 89: | Line 93: | ||
</ | </ | ||
==== Some errors and fix ==== | ==== Some errors and fix ==== | ||
- | < | + | - Error 1:< |
- | </ | + | </ |
- | + | * 2.2 configuration:< | |
- | In this example, to config all requests are allowed: | + | |
- | * 2.2 configuration:< | + | |
Order allow,deny | Order allow,deny | ||
Allow from all | Allow from all | ||
</ | </ | ||
- | | + | |
Require all granted | Require all granted | ||
</ | </ | ||
+ | - Error2: | ||
===== Install XAMPP ===== | ===== Install XAMPP ===== | ||
refer: https:// | refer: https:// |
php/php-apache-on-windows.1463649760.txt.gz · Last modified: 2022/10/29 16:15 (external edit)