- 论坛徽章:
- 0
|
windows下php配置apache
注意: 记住当在 Windows 环境下的 Apache 配置文件中添加路径值时,所有的反斜线,如 c:\directory\file.ext,应转换为正斜线: c:/directory/file.ext。对目录来说,也必须由斜线结尾。
在httpd.conf最后一行追加如下:
Java代码- 1. #
- 2. LoadModule php5_module "c:/php/php5apache2.dll"
- 3. AddHandler application/x-httpd-php .php
- 4.
- 5. # configure the path to php.ini
- 6. PHPIniDir "C:/php"
- 7.#The above configuration will enable PHP handling of any file that has a .php extension,
- 8.#even if there are other file extensions. For example, a file named example.php.txt will be executed by the PHP handler.
- 9.#To ensure that only files that end in .php are executed, use the following configuration instead:
- 10.<FilesMatch \.php$>
- 11. SetHandler application/x-httpd-php
- 12. </FilesMatch>
- #
- LoadModule php5_module "c:/php/php5apache2.dll"
- AddHandler application/x-httpd-php .php
- # configure the path to php.ini
- PHPIniDir "C:/php"
- #The above configuration will enable PHP handling of any file that has a .php extension,
- #even if there are other file extensions. For example, a file named example.php.txt will be executed by the PHP handler.
- #To ensure that only files that end in .php are executed, use the following configuration instead:
- <FilesMatch \.php$>
- SetHandler application/x-httpd-php
- </FilesMatch>
复制代码 在
引用- <IfModule dir_module>
- DirectoryIndex index.html
- </IfModule>
复制代码 index.html 后面加上 index.php,变成:
Java代码- 1.<IfModule dir_module>
- 2. DirectoryIndex index.html index.php
- 3.</IfModule>
- <IfModule dir_module>
- DirectoryIndex index.html index.php
- </IfModule>
复制代码 在php.ini最后加入:
Java代码- 1.# php timezone configure
- 2.date.timezone = "Asia/Shanghai"
- 3.
- 4.date.default_latitude = 31.5167
- 5.date.default_longitude = 121.4500
复制代码 |
|