I have my own configuration file in my CI application. In my web application admin panel, I want to have a form that I can use to change the values ββof the config array of a user file. My problem right now is that the write_file function always returns false, and I don't know why. I am sure that I write the path in the function correctly, and the config directory is not read-only (this is wamp, therefore Windows). The file definitely exists. What am I doing wrong?
This app / controllers / config / assets.php
$file = FCPATH . 'application\config\assets_fe.php'; if(is_writable($file)) { $open = fopen($file, 'W'); if(!fwrite($open, $frontend)){ echo "Could not write file!"; } else { echo "File written!"; } } else { echo "File not writable!"; }
This is a screenshot of the file at its location in Windows Explorer. 
I tried the following file paths in the write_file function:
write_file(FCPATH.'application/config/assets_fe.php', $frontend, 'W'); write_file('application/config/assets_fe.php', $frontend, 'W'); write_file('./application/config/assets_fe.php', $frontend, 'W');
None of the above file paths worked ... maybe this is something else?
FYI: FCPATH = 'W: \ wamp \ www \ zeus \' and it is determined by the CI controller before returning the path to this file.
Update: I tried to use only my own version of PHP, and he said that the file or directory does not exist. Maybe I'm using the wrong way. What should it be?
file php codeigniter
ShoeLace1291
source share