0

有人问我为什么作为 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>

文件中的代码是:

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';
4

0 回答 0