Home >Backend Development >PHP Tutorial >Why Isn't My Apache Server Executing PHP Code on Windows Vista?

Why Isn't My Apache Server Executing PHP Code on Windows Vista?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-12-17 22:28:12977browse

Why Isn't My Apache Server Executing PHP Code on Windows Vista?

Apache Failure to Execute PHP Code: Resolving Display Issues

When attempting to install PHP and Apache on Windows Vista, users may encounter situations where PHP code displays as source rather than executing. This article provides a solution to this specific problem.

Troubleshooting the Issue:

To resolve this issue, follow these steps:

1. Check mod-Enabled Folder:

Navigate to the Apache directory (default: /etc/apache2/mods-enabled) and search for a file named php.(extension). Enable this file (if not already done).

2. Examine Error Log:

Inspect the error log located at /var/log/apache2/error.log for any additional error messages that could further troubleshoot the problem.

Example Configuration:

For PHP.INI:

short_open_tag = On

For HTTPD.CONF:

LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir "C:/php"

Following these steps should enable PHP execution and prevent source code display in Apache.

The above is the detailed content of Why Isn't My Apache Server Executing PHP Code on Windows Vista?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn