Jump to content

RyanFox

New Members
  • Posts

    3
  • Joined

  • Last visited

RyanFox's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I'm trying to create a file in my home dir and in my etc folder but I keep getting permission denied. I am doing this $myFile = "/home/ng/http/uid.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "test\n"; fwrite($fh, $stringData); fclose($fh); I have tried to chmod 777 the file but still no luck. I am using centos 6, what should I do to fix this issue? Thanks, Ryan
  2. Hello, I have multiple str_replace with file_put_contents in my script and it only seems to run the last str_replace. If I remove the last one it runs the first one fine. Code: $file_name = "txt.txt"; $contents = file_get_contents($file_name); //first $updom = str_replace("google.com",$domain,$contents); file_put_contents($file_name, $updom); //last $upip = str_replace("74.125.226.110",$ip,$contents); file_put_contents($file_name, $upip); google.com and that ip are just for testing. If I run that the ip one works but not the domain one, if I comment out the IP one the domain one works fine... What is going on? Thanks, Ryan
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.