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. ^_^