Oct 16, 2009
AMFPHP Fatal Errors After PHP 5.3 Upgrade (Part 2)
As promised in Part 1, I'm documenting yet another issue that must be addressed in your AMFPHP installation upon upgrading to PHP 5.3. This issue stems from the usage of the
) and jump to line 505. Once there, you need to replace these three lines:
with these equivalent lines of code:
Save and close the file, fire up your service browser and you should now be good to go with no more fatal errors in your AMFPHP applications produced by this deprecated function. Happy coding!
eregi_replace function that has been deprecated in PHP 5.3. If you run into a fatal error in your AMFPHP application with the message Function eregi_replace() is deprecated, you have (2) options:
- Modify your PHP configuration to disable the warnings
- Replace the deprecated code with the new, recommended equivalent
MethodTable.php which can be found @ /path/to/amfphp/core/shared/util/MethodTable.php. Open up this file in your favorite text editor (ie, TextMate
) and jump to line 505. Once there, you need to replace these three lines:
$comment = eregi_replace(”\n[ \t]+”, “\n”, trim($comment)); $comment = str_replace(”\n”, “\\n”, trim($comment)); $comment = eregi_replace(”[\t ]+”, ” “, trim($comment));
$comment = preg_replace(”'\n[ \t]+'U”, “\n”, trim($comment)); $comment = str_replace(”\n”, “\\n”, trim($comment)); $comment = preg_replace(”'[\t ]+'U”, ” “, trim($comment));
