ZendServer和php包含-处理不正确


Zend Server and php includes - not processing correctly

我在Zend服务器上运行的php codeingniter应用程序中遇到了config.php中的一些代码,该应用程序会检查是否存在另一个文件configx.php。如果存在,它会包含它,否则它会在自己内部执行代码。它看起来像这样:

if (file_exists('/opt/myapp/configx.php')) {
    include '/opt/myapp/configx.php';
} else {
.... normal config code 

(configx.php不包括对configx.php的检查)

当我尝试运行该应用程序时(我尝试过chrome和firefox),它没有识别出需要解释的文件,而是尝试下载它。文件类型为:

application/x-httpd-php

这在zend.conf:中处理

AddHandler zend-enabler-script .php 
AddType application/x-httpd-php .php   

但是httpd.conf.中没有提到

包含此文件的最佳方式是什么?这是unix/windows的问题吗?

可能存在语法错误。您可以通过运行进行检查

php -l /opt/myapp/configx.php