Development Environment Problems (win7 + vbox + centos + nginx + php), problems with saving JS files

Source: Internet
Author: User
Tags sendfile
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.