This will not happen if PHP does not handle the request for the .js file.
Check the Apache2 conf file, and also check the conf.d files in the conf.d folder. Also check the .htaccess file. Find something like this in these files:
AddHandler application/x-httpd-php .js
This can happen in a block like this:
<FilesMatch ".js$"> AddHandler application/x-httpd-php .js php_value default_mimetype "text/javascript" </FilesMatch>
Some tutorials for setting up .htaccess and apache suggest using PHP to process .js files due to some tricks that this will allow you to do. The most common reason is to call the PHP GZIP file in zip compression of JS files. Unfortunately, using php to handle tiny_mce.js seems to interrupt Wordpress. PHP disables something in tiny_mce.js file - perhaps because it was minimized?
I ran into this exact problem and had to remove the php handler for .js files from my configuration. Actually, there was no need for this because my Apache was set up to write itself. I do not name the PHP file to make gzip. Relying on a PHP script to compress zip is really not the best way to do things (obviously because it creates problems like this!).
Hope this helps someone.
Readers may also find this post helpful: Caching issue using AddHandler / x-httpd-php "
I will also add that the arbitrary use of PHP to handle static files such as JS and CSS is not a good idea for performance reasons. You should never call a PHP handler unless the files are truly dynamic. Otherwise, you add unnecessary resource requirements to the server.
source share