0

I need to add some content to a file from a controller in CodeIgniter, in my local enviroment I do this and works fine:

$handle = fopen(APPPATH."config/file.php", "a+");
fwrite($handle, $stuff);

fclose($handle);

However the file doesn't seem to get altered when it runs in the production environment server.

At first I though it could be permission issues but chmoding 777 the directory doesn't seem to work either

jonathanwiesel
  • 1,036
  • 2
  • 16
  • 35

2 Answers2

0

It seems to me APPPATH is pointing to a different path. Make sure APPPATH is correct.

u54r
  • 1,767
  • 2
  • 15
  • 26
0

Dumb of me, I chmoded the folder containing the file but not the file itself.

jonathanwiesel
  • 1,036
  • 2
  • 16
  • 35