我在这里search了几个问题,但没有一个似乎回答我的问题。 我一直在使用Apache 2.2.21 / PHP 5.3.9一段时间,仍然正常工作。 我下载并安装了Apache 2.4.10 / PHP 5.5.14,目前为止似乎没有执行PHP代码。 PHP模块被加载。 我的猜测是在PHP方面的问题。 这是控制台的输出。
C:\server\Apache2.4\bin>httpd -v Server version: Apache/2.4.10 (Win32) Apache Lounge VC11 Server built: Jul 17 2014 11:50:08 C:\server\Apache2.4\bin>httpd -M Loaded Modules: core_module (static) win32_module (static) mpm_winnt_module (static) http_module (static) so_module (static) access_compat_module (shared) actions_module (shared) alias_module (shared) allowmethods_module (shared) asis_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_groupfile_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) cgi_module (shared) dir_module (shared) env_module (shared) include_module (shared) isapi_module (shared) log_config_module (shared) mime_module (shared) negotiation_module (shared) rewrite_module (shared) setenvif_module (shared) php5_module (shared) C:\server\Apache2.4\bin>..\..\php-5.5\php -v PHP 5.5.14 (cli) (built: Jun 25 2014 12:40:49) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies C:\server\Apache2.4\bin>..\..\php-5.5\php -m [PHP Modules] bcmath calendar Core ctype curl date dom ereg filter ftp hash iconv json libxml mbstring mcrypt mhash mongo mysql mysqli mysqlnd odbc openssl pcre PDO pdo_mysql Phar Reflection session SimpleXML SPL standard tokenizer wddx xml xmlreader xmlwriter zip zlib [Zend Modules]
当我切换到Apache 2.2 / PHP 5.3一切正常。 我已经尝试添加AddType application/x-httpd-php .php .phtml .php3但没有运气。 在PHP中不使用短标签。
php.ini和httpd.conf的副本在这里=> https://www.dropbox.com/sh/b0dejatwn6ephid/AACbZ6ORcJwncVqRs7S1KrCxa
希望如果有人能帮我解决这个问题。
快速查看你发布的configuration,看起来AddHandler设置丢失了:
#BEGIN PHP-5.5 PHPIniDir "C:\server\php-5.5\" LoadModule php5_module "C:\server\php-5.5\php5apache2_4.dll" AddHandler application/x-httpd-php .php
这就是指示Web服务器和PHP5模块一起parsing.php文件,而不是将它们作为纯文本。