Development Environment Problems (win7 + vbox + centos + nginx + php), saving JS files problems in order to develop well, I downloaded vbox and shared folders in win7, the development environment is set in centos in vbox. However, when saving the js file, some inexplicable things appear in it. when the browser reads the JS file, an error is reported. However, this file can be opened and saved in linux.
I tried many methods, such as how to save the file format, utf8, utf8 bom, etc.
Is saving files in linux different from that in Windows 7 7 (the format of the disk where win7 shared files are stored is NTFS)
Reply to discussion (solution)
No vbox used
I used samba and win to map the samba Directory. it's okay for win to use netbeans or editplus to write JavaScript.
I don't know what your js error message is.
Echo base64_encode (file_get_contents ('problematic js file '));
The output is base64, and byond compare are identical.
This doesn't make sense. js files are problematic during browser parsing.
For Mao linux, can it be used once it is saved?
I guess it is an nginx cache problem. I am searching for this problem.
Yes. I want to see what the problem is.
If you don't want to show it to me, forget it.
The problem is clear, but no solution is found.
I changed a js file in windows, and then accessed it in the browser. an error is reported. I cp this file in linux, deleted it, and then cp the backup file back to the original file. OK.
That is to say, nginx cache is a joke.
I set static file access cache expires to off
Adding a changed version number to the introduced file does not solve the problem.
Note that the shared folder format is vboxsf, and the Linux sendfile module function may not work properly. If the sendfile module is enabled in their configuration files, some common web servers such as Nginx and Apache may cause file content errors to be returned to the client. If you are interested in the specific description of this issue, you can Google "vboxsf sendfile. Currently, we recommend that you disable the sendfile module by referring to the specific configuration methods of these services to ensure that the file content can be correctly sent.
Perfect solution:
Nginx settings
Change sendfile on to off
This is limited to the development environment.