Php 内容/类型有问题:text/javascript

Php 内容/类型有问题:text/javascript,php,apache,http-headers,Php,Apache,Http Headers,有人问我为什么作为javascript文件工作的php文件不工作 我在大约20台不同的服务器上进行了测试,包括本地计算机,我无法复制他的错误 他的错误是: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webma

有人问我为什么作为javascript文件工作的php文件不工作

我在大约20台不同的服务器上进行了测试,包括本地计算机,我无法复制他的错误

他的错误是:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.3 (CentOS) Server at domain.com Port 80
我的一台服务器处于调试模式,没有任何错误

他的服务器是否需要激活或安装某些东西才能正常工作

即使我删除文件中的任何代码,它仍然会给出一个500错误

那么这是否意味着他的站点不能在脚本中运行php扩展,如:

<script type='text/javascript' src='http://domain.com/services/wp-content/themes/themename/js/sharrre.js.php?ver=1.0'></script>

你的朋友看过服务器错误日志了吗?@andrewsi-不,他不知道怎么做,他也不给访问权限,所以我只是想知道是否是服务器而不是代码,如果是服务器没有所需的,我可以告诉他,如果相同的代码在你的机器上工作,而在他的机器上不工作,然后他的电脑出现了配置问题。错误日志会准确地告诉他问题是什么,但我们只能猜测——这里有一些关于设置PHP以显示的有用信息errors@andrewsi-我已将错误报告设置为“显示”,并将wordpress设置为“调试”,没有显示错误。对不起。我的意思是他必须这样做,这样他才能看到失败的地方。
header('Content-Type: text/javascript');

$parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] );
require( $parse_uri[0] . 'wp-load.php' );

$urlpath = get_stylesheet_directory_uri() . '/js/sharrre.php';