We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31283
    • 22 Posts
    Hi there,

    I’ve got a site which was working great on a server with PHP 5.2; however, once we moved it to a new server with PHP 5.3 the site instantly choked.

    It looks like this is due to a snippet that is calling a Zip Code Locator script that we bought from Code322. The main file apparently uses ’ereg_replace’, which has been deprecated in PHP 5.3.

    The problem is difficult because the code for this php file is encrypted and the author has stated that reverse engineering is prohibited. This is going to be a large commercial site, so I certainly want to stick to the book.

    To further complicate things, when I run an ’example.php’ that was provided by the author, from the ’assets/files’ folder, it works fine. It is only when accessing through a snippet that the errors are thrown and the site breaks.

    Any ideas or information would be greatly appreciated. Thank you.


    • PHP Version 5.3.2-1ubuntu4.5
    • Apache 2.2.14
    • Mysql 5.1.41

    • ModX 1.04

      • 3749
      • 24,544 Posts
      Add this in php.ini in the MODx root:

      error_reporting E_ALL & ~E_DEPRECATED

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 31283
        • 22 Posts
        Thank you for the help. I tried adding this to the ModX root, as well as editing the php.ini file that was path-referenced by phpMyAdmin, but no luck.

        I’ve also edited the config.inc.php file, but that didn’t do anything either.

        Any other suggestions for suppressing these ’errors’?

        Edit: Resolved!