• After I upgraded to PHP7 the Redirection plugin is giving me HTTP Error 500 errors when I try to load any of the Redirection pages. Switching the PHP version back to 5.6 fixes the problem. Why is the plugin crashing with PHP7?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter zerokarma

    (@zerokarma)

    This is with the latest version of Redirection 2.6.1.

    Plugin Author John Godley

    (@johnny5)

    What does your PHP error log say? The plugin is running with PHP7 on my site.

    @johnny5 – I got similar problems with PHP7.

    The main issue on my side is, that the static functions inside the classes are not declared public. Therefore they are not accessible anymore in PHP7 without raising an E_DEPRECATED error.

    The only thing you need to change is: mark ALL

    static function…

    as

    static public function…

    I use some of the operations from my plugin and they don’t work anymore (results into a 500).

    E.g. see:

    Red_Item::get_all_for_module
    Red_Item::get_for_url

    Red_Item::create

    Red_Group::get
    Red_Group::get_for_select
    Red_Group::create

    Thank you!

    Plugin Author John Godley

    (@johnny5)

    Thanks Zomcat! I’m not sure the original problem is related to deprecated warnings – they shouldn’t cause a HTTP 500 error.

    Also I’m unaware of static functions needing to be public – what is the log message you are seeing? The PHP site says that static functions with no specified visibility will default to public (https://php.net/manual/en/language.oop5.static.php). I’m developing and using the plugin myself on PHP7 and cannot produce deprecated warnings. Do you have anything configured with your PHP that I might be missing? What’s the exact version you are using?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP7 giving HTTP Error 500’ is closed to new replies.