简体   繁体   English

拒绝从“ file_name.php”执行脚本,因为其MIME类型(“ text / html”)不可执行,并且启用了严格的MIME类型检查

[英]Refused to execute script from 'file_name.php' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled

I make a site. 我做一个网站。 It's working properly on my local server but when I upload it to live server it is giving me this error: 它在我的本地服务器上正常工作,但是当我将其上传到实时服务器时,出现此错误:

Refused to execute script from ' http://www.mahijat.tk/new/wp-content/cache/autoptimize/autoptimize_c648c3203309d095775637e672c00239.php ' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 拒绝执行来自' http://www.mahijat.tk/new/wp-content/cache/autoptimize/autoptimize_c648c3203309d095775637e672c00239.php '的脚本,因为其MIME类型('text / html')无法执行,并且必须进行严格的MIME类型检查已启用。

My site URL is http://www.mahijat.tk/new/ 我的网站网址是http://www.mahijat.tk/new/

My index.php file code is 我的index.php文件代码是

<!doctype html>
<html lang="en-US" prefix="og: http://ogp.me/ns#" class="no-js ">

<head><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:image" content="../pbs.twimg.com/profile_images/601407094277873664/WT2mk28E_400x400.jpg" />
<link type="text/css" media="all" href="wp-content/cache/autoptimize/autoptimize_ac4e9617d860b901a683f7676a3c44be.css" rel="stylesheet" />
<link type="text/css" media="all" href="wp-content/font-awesome/css/font-awesome.min.css" rel="stylesheet" />

This is usually a Chrome error that happens when you make an AJAX jsonp request to a page that returns javascript but incorrectly sends a Content-Type: text/html header. 这通常是Chrome错误,发生在您向返回javascript但错误地发送Content-Type: text/html标头的页面发出AJAX jsonp请求时发生。

You can fix it by changing your autoptimize_.....php file to send the proper Content-Type header before outputting the javascript: 您可以通过在输出javascript之前更改autoptimize_.....php文件以发送适当的Content-Type标头来解决此问题:

<?php
header('Content-Type: application/javascript');
// rest of the code

Please go and refer the link 请去参考链接

Hope this might help you. 希望这对您有帮助。

Try to do a hard refresh (CMD + SHIFT + R). 尝试进行硬刷新(CMD + SHIFT + R)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GeoJSON 文件:拒绝执行脚本,因为其 MIME 类型 (&#39;&#39;) 不可执行,并且启用了严格的 MIME 类型检查 - GeoJSON file: Refused to execute script from because its MIME type ('') is not executable, and strict MIME type checking is enabled 拒绝从 &#39;URL&#39; 执行脚本,因为它的 MIME 类型 (&#39;text/html&#39;) 不可执行,并且启用了严格的 MIME 类型检查 - Refused to execute script from 'URL' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled Angular 6:拒绝从“URL”执行脚本,因为它的 MIME 类型()不可执行,并且启用了严格的 MIME 类型检查 - Angular 6 : Refused to execute script from 'URL' because its MIME type( ) is not executable, & strict MIME type checking is enabled 拒绝执行脚本,因为 MIME 类型('text/html')不可执行,并且启用了严格的 MIME 类型检查 - Refused to execute script because MIME type ('text/html') is not executable, and strict MIME type checking is enabled 启用了严格的 mime 类型检查,拒绝执行来自 ' 的脚本<url> ' 它的 mime 类型 ('text/plain') 是不可执行的,并且</url> - strict mime type checking is enabled, refused to execute script from '<url>' its mime type ('text/plain') is not executable, and 拒绝执行脚本,因为它的 MIME 类型 ('application/gzip') 不可执行,并且启用了严格的 MIME 类型检查 - Refused to execute script because its MIME type ('application/gzip') is not executable, and strict MIME type checking is enabled 拒绝应用“ <URL> &#39;,因为它的MIME类型(&#39;text / html&#39;)不是受支持的样式表MIME类型,并且启用了严格的MIME检查 - Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled 拒绝从&#39;*&#39;执行脚本,因为它的MIME类型(&#39;application / json&#39;)不可执行,并且严格的MIME类型为che - getting Refused to execute script from '*' because its MIME type ('application/json') is not executable, and strict MIME type che 拒绝从...应用样式,因为它的 MIME 类型 (&#39;text/html&#39;) 不是受支持的样式表 MIME 类型,并且启用了严格的 MIME 检查 - Refused to apply style from... because its MIME type ('text/html') is not a supported style-sheet MIME type, and strict MIME checking is enabled 拒绝从“http://127.0.0.1:5500/”执行脚本,因为它的 MIME 类型(“text/html”)不可执行 - Refused to execute script from 'http://127.0.0.1:5500/' because its MIME type ('text/html') is not executable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM