Nam Phung
Nam Phung

Reputation: 97

Suddenly error with wordpress only with nginx (Uncaught SyntaxError: Unexpected end of input)

I've installed Wordpress on my VPS and is run smoothly with apache2. But recently , I recognized that it consume too much RAM (~600MB for 7-8 session) so I decided to change to Nginx. After changing for few days, it's working fine, without any problem but suddenly yesterday, the Admin Page layout was destroyed. I looked into the console log and found out this problem: Uncaught SyntaxError: Unexpected end of input, the file was wp-admin/load-scripts.php.

You can access to the file directory as

http://vietnammechkey.com/wp-admin/load-scripts.php?c=0&load%5B%5D=jquery-core,jquery-migrate,utils,json2&ver=3.8.2

The file will be longer if I use Apache2 and it will be sorter if I use nginx

Note: The Wordpress working perfectly on Apache2.

Upvotes: 0

Views: 2215

Answers (1)

Benito
Benito

Reputation: 700

This is a fairly old question, and I guess by now you must have figured it out by yourself. I just came across the same issue. In my case, it was caused by bad permissions. Excerpt from my /var/log/nginx/error.log:

2015/03/13 16:07:18 [crit] 21806#0: *276 open()
"/var/lib/nginx/fastcgi/2/03/0000000032" failed (13: Permission denied)
while reading upstream, client: 81.253.76.64, server: yoga-maragata.fr, request:
"GET /wp-includes/js/tinymce/wp-tinymce.php?c=1&ver=4107-20150118 HTTP/1.1",
upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.yoga-maragata.fr",
referrer: "http://www.yoga-maragata.fr/wp-admin/post.php?post=7&action=edit"

It was obviously a permission issue, and as it happens, I had just changed the nginx user setting in /etc/nginx/nginx.conf. Reverting to www-data solved the issue.

Upvotes: 1

Related Questions