We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39404
    • 175 Posts
    stalemate resolution associate Reply #1, 10 years, 3 months ago
    Hello everyone,

    I woke up this morning and was logging into one of my clouds, and the site wasn't working. My cloud right now is in development, so it's not as though there is any kind of outage.

    Looking at the log at /log/error.log, it showed similar to the following:

    [22-Dec-2013 06:29:59 America/Chicago] PHP Fatal error:  Call-time pass-by-reference has been removed in /paas/mycloud/www/core/components/my/badly/Coded.class.php on line 115


    This has to do with call-time passes by reference which occur when you do something like this:
    $output = somefunction(&$ohMy);


    If you remove the ampersand (&), the error will go away. This wasn't an issue with the upgrade, but rather the fact that this was depreciated in PHP 5.3 and just threw a warning, but in PHP 5.4.

    I don't think this will be something that people run across often, given that they are probably properly coding, but on the off chance people have old code like mine that suddenly breaks, this is how to fix it.

    Regards,
    Tom
    • Thanks for passing on this heads up, Tom. Much appreciated.
        Mike Schell
        Lead Developer, MODX Cloud
        Email: [email protected]
        GitHub: https://github.com/netProphET/
        Twitter: @mkschell
        • 36426
        • 197 Posts
        Hi can anyone help with this problem. I've just upgraded my server PHP to 5.4 and lots of sites are now down due to this error. As I'm not sure how many sites are down or which ones is there anything that can be done from WHM or when installing PHP to fix this rather than editing the files in Modx?

        I've tried deleting the cache folder for some of the sites and as the files are just recreated on visiting the website then the problem just reoccurs.

        Thanks again for any help.
          Yorkshire UK based hosting provider: https://www.simulant.uk
          • 3749
          • 24,544 Posts
          There's really no fix other than downgrading PHP or editing the files to remove the & in the function calls.
            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
            • 36426
            • 197 Posts
            As I've also posted in a similar thread about this, it ended up being down to some sites having been attacked by SQL injection! All is now fixed with the hacker's files and sql rows removed! Thanks to Bob and everyone who helped.
              Yorkshire UK based hosting provider: https://www.simulant.uk