Migrating from PHP4 domxml to PHP5 dom
Posted by Jon Lee in Site stuff, Web Development, tags: dom, domxml, PHP, programming, Surf-Handsfree, web developmentAfter migrating my servers entirely over to PHP5, my SurfHandsFree site stopped working properly. The problem was that it uses the domxml_open_file function which is a PHP4 function and isn’t supported in PHP5.
PHP5 instead uses the dom extension instead which has more features but isn’t backwards compatible with domxml.
Instead of changing all of my code to be compatible with PHP5 (which is perhaps a better solution), I found a module that basically implements all of the PHP4 domxml functions but using the new dom extension.
All you need to do is to put the provided file, domxml-php4-to-php5.php in the directory of the script (or any directory) and include it at the top of your code with:
<?php require_once(“domxml-php4-to-php5.php”); ?>
A big thanks to Alexandre Alapetite for writing this module!
Popularity: 13% [?]
Entries (RSS)