File_put_contents error: failed to open stream: Invalid argument one reason, invalidromcontents

Source: Internet
Author: User

File_put_contents error: failed to open stream: Invalid argument one reason, invalidromcontents

When testing the nilcms system today, an error is reported, causing the cache to fail to be updated:

File_put_contents (C: \ UPUPW_AP5.4 \ vhosts \ d. TV \ NilCMS_APP \ include_run/config_site.php): failed to open stream: Invalid argument C: \ UPUPW_AP5.4 \ vhosts \ d. TV \ NilCMS_20160520 \ core \ common. python 129

The test environment uses win7 64-bit and UPUPW environment suite.

The file is generated using the file_put_contents function. Other files in this directory are generated without any problems, and only config_site.php cannot be written. Tangle...

Analysis process:

1. The config_site.php file will be directly loaded before the nilcms system runs. Will it affect writing? After testing and loading the file and modifying it, there is no problem.

2. All kinds of questions, all kinds of tangle, feel speechless.

3. It is found that the function used when the config_site.php file is introduced is require_once. Changed to require and found that the generated cache is no problem. Solve the problem.

Some notes:

1. You have not encountered such a problem when using your own wamp environment (XWAMP.

2. There is no such problem in the linux virtual host environment.

3. Why can I change this function to solve this problem? I don't know. I can share it with anyone I know.

4. I feel a lot better. ^_^

 

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.