| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Seasoned Poster
Joined in Feb 2007
74 posts
Gave thanks: 2
Thanked 5 times
|
Cannot redeclare file_put_contents() after sh59 upgrade
I have a webcam script that contains the following code that was working on surpass sh59 until last night at 2:15 a.m.. I see there was an upgrade notice that said php was being upgraded: SH59 (72.29.74.79): Shared but I'm not sure exactly what changed.
As of 2:15 a.m. the script started returning the error: PHP Fatal error: Cannot redeclare file_put_contents() I'm not up to speed with php5 -- can someone give me some help on how the following should be recoded to work with the 5/3/08 php/server upgrade? if($increment) { $args['head'] = $head; $args['tail'] = $tail; $argString = implode_with_keys("\n",$args); file_put_contents($status_file, $argString, LOCK_EX); } $args['max_count'] = $max_count; return $args; } function file_put_contents($n,$d) { $f= fopen($n,"w");if (!$f) { return false; } else { fwrite($f,$d); fclose($f); return true; } }
__________________
|
|
|
|
|
|
#2 (permalink) |
|
Registered User
Excelling Contributor
Joined in Mar 2007
Lives in Wales
Hosted on dime999
620 posts
Gave thanks: 47
Thanked 46 times
|
It means that the function is already there. You had to put the function in manually in PHP 4 but after the upgrade it is there, and you manual entry is superfluous.
__________________
Markus |
|
|
|
| This user thanks mgk for this great post! | Island (June 6th, 2008) |