Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    php scripting and PHP shell broken after update

    Scheduled Pinned Locked Moved General pfSense Questions
    4 Posts 3 Posters 294 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      Piktor10
      last edited by

      I just recently updated my pfsense firewall and now my php scripts I used for automation don't longer work.
      Testing via PHP shell is also not working. None of the examples listed in the help command of the PHP shell is working.
      Just no output at all!
      My scripts are failing when accessing $config[filter][rule] , but I have found nothing about changed api?

      Please give me some advice!

      1 Reply Last reply Reply Quote 0
      • bmeeksB
        bmeeks
        last edited by bmeeks

        Go have a read at this link: https://docs.netgate.com/pfsense/en/latest/development/php-config-arrays.html.

        Several things have changed in PHP over the last few pfSense updates. For one, PHP 7.x has been replaced by pfSense 8.x, and 8.x behaves much differently with regards to throwing full blown errors and halting on syntax and code structure problems that PHP 7.x would just ignore, make an educated guess on what the programmer meant, and then move on.

        So, the API did in fact change in a way. In particular you can't use direct access to an array element in a variable that is not actually defined as an array. Thus things that just sort of got ignored in PHP 7.x will now cause a halt in PHP 8.x (probably breaking the script).

        P 1 Reply Last reply Reply Quote 1
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          What did you update from? to?

          1 Reply Last reply Reply Quote 0
          • P
            Piktor10 @bmeeks
            last edited by

            @bmeeks
            why the PHP shell i reach from menu point 12 does not give any hints?
            All the examples given in the help commands don't work.

            As this is the place, where I tested my scripts, I expected to get information about changes there.

            Thanks for your link, I will dig from there.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.