生产服务器上的TinyMCE Javascript文件500内部服务器错误

时间:2021-03-10 15:39:08

I have a website made with CakePHP, with a plugin I made modified from CakeDC TinyMCE plugin

我有一个用CakePHP制作的网站,我从CakeDC TinyMCE插件修改了一个插件

This all works well on my development server, but when I upload to production (HostGator) the TinyMCE textareas do not load correctly, and the Console shows X GET .. path_to_TinyMCE_JS_File.js

这在我的开发服务器上运行良好,但是当我上传到生产(HostGator)时,TinyMCE textareas无法正确加载,并且控制台显示X GET .. path_to_TinyMCE_JS_File.js

My other plugins work fine so not a plugin loading problem

我的其他插件工作正常,所以不是插件加载问题

I know I have the paths etc correct as when i load a test.js file into the same folder and navigate to that I can see that file contents

我知道我有路径等正确,因为当我将test.js文件加载到同一文件夹并导航到我可以看到该文件内容

When I navigate to the js file, I should be able to see the JS text, but it 'renders' as an empty file/blank page. In the console it tells me I have a "500" Internal Server Error

当我导航到js文件时,我应该能够看到JS文本,但它“呈现”为空文件/空白页面。在控制台中它告诉我我有一个“500”内部服务器错误

I have re-uploaded the JS file and it seems like it should be fine (right file size etc). Permissions seem okay (0644).

我重新上传了JS文件,看起来应该没问题(正确的文件大小等)。权限似乎没问题(0644)。

I'm using TinyMCE 4.0.26 (I did try uploading the latest TinyMCE JS and got the same 500 error) via the CakeDC TinyMCE CakePHP Plugin, CakePHP 2.3 (I think..)

我正在使用TinyMCE 4.0.26(我尝试上传最新的TinyMCE JS并获得相同的500错误)通过CakeDC TinyMCE CakePHP插件,CakePHP 2.3(我认为......)

I'm not sure what to try next, any help much appreciated

我不确定下一步该尝试什么,任何帮助都非常感激

2 个解决方案

#1


0  

if you are getting a 500 error, the only logical thing to do is checking the error logs on your server. The location of logs changes depending on your web-server software and os. But by default on linux/apache you can find your error logs under /var/log/apache2/ if you open up your related error log with;

如果您收到500错误,唯一合乎逻辑的做法是检查服务器上的错误日志。日志的位置根据您的Web服务器软件和操作系统而变化。但是默认情况下在linux / apache上你可以在/ var / log / apache2 /下找到你的错误日志,如果你打开你的相关错误日志;

tail -f /var/log/apache2/[your-site-name]-error.log 

then simply refresh the page from the browser to see the latest logs of errors. That way, you will be able to identify the problem. If you cant identify it yourself, just copy/paste the error here.

然后只需从浏览器刷新页面即可查看最新的错误日志。这样,您将能够识别问题。如果您无法自己识别,只需在此处复制/粘贴错误。

#2


0  

Yay, have finally found the solution here!

是的,终于在这里找到了解决方案!

The problem here is that in HostGator php Short Tags are on by default. There is a

这里的问题是在HostGator中,php Short Tags默认打开。有一个

I had to modify my php.ini file on HostGator to turn off short tags, all good now!

我不得不在HostGator上修改我的php.ini文件以关闭短标签,现在一切都好!

This post is what got me over the line: Why is the JavaScript file parsed as PHP in my Cake plugin?

这篇文章让我了解了一下:为什么我的Cake插件中的JavaScript文件被解析为PHP?

#1


0  

if you are getting a 500 error, the only logical thing to do is checking the error logs on your server. The location of logs changes depending on your web-server software and os. But by default on linux/apache you can find your error logs under /var/log/apache2/ if you open up your related error log with;

如果您收到500错误,唯一合乎逻辑的做法是检查服务器上的错误日志。日志的位置根据您的Web服务器软件和操作系统而变化。但是默认情况下在linux / apache上你可以在/ var / log / apache2 /下找到你的错误日志,如果你打开你的相关错误日志;

tail -f /var/log/apache2/[your-site-name]-error.log 

then simply refresh the page from the browser to see the latest logs of errors. That way, you will be able to identify the problem. If you cant identify it yourself, just copy/paste the error here.

然后只需从浏览器刷新页面即可查看最新的错误日志。这样,您将能够识别问题。如果您无法自己识别,只需在此处复制/粘贴错误。

#2


0  

Yay, have finally found the solution here!

是的,终于在这里找到了解决方案!

The problem here is that in HostGator php Short Tags are on by default. There is a

这里的问题是在HostGator中,php Short Tags默认打开。有一个

I had to modify my php.ini file on HostGator to turn off short tags, all good now!

我不得不在HostGator上修改我的php.ini文件以关闭短标签,现在一切都好!

This post is what got me over the line: Why is the JavaScript file parsed as PHP in my Cake plugin?

这篇文章让我了解了一下:为什么我的Cake插件中的JavaScript文件被解析为PHP?