Latest update left PFSENSE without php-mysql support



  • Hi,

    after this morning update, my captive portal webpage which contains a mysql_connect order, stopped working

    [20-Jan-2016 11:58:46 Europe/Madrid] PHP Fatal error:  Call to undefined function mysql_connect() in /var/etc/captiveportal_cpzone.html on line 23

    Tryin to activate php56-mysql via php_dynamodules without success

    Any idea of what happened in the latest update to amd64 version?

    Thanks



  • Probably (taken from PHP.net):

    Warning

    This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:

    mysqli_connect()
        PDO::__construct()

    BR,
    Greg



  • Just installed my virtual machine again using the yesterdays amd64 iso.

    Then I loaded my saved config.xml and upgraded using

    pkg upgrade -f

    from the console. Dunno what happened, but now it works…

    Please someone will be kindly enough to let me know if the new 2.3 version will have support for php connectivity to mysql? This is a crucial point for my captive portal projects, and I need to know if plans are to have native support or it will work as the mess it was in previous versions.

    There are other open source firewalls out there with php-mysql support, but I prefer pfsense. But this is a must have.

    Thanks!


  • Rebel Alliance Developer Netgate

    The way pkg works it's safe now to leave that off the base system and allow it to be installed manually or as a package dependency. We're trimming out a few similar things.

    You can install it as follows:

    pkg install php56-mysql
    

    And then it will work as you're used to.

    On prior versions of pfSense, doing that was dangerous so we had to build that in or it would never have worked properly. Once all that settles we'll update documentation to reflect the new procedure.



  • Thanks Jimp,

    already tried this, but console said that package was not available…

    also I did a pkg search php56 and that one did not popup...

    Now, in my rebuilded machine, if I do a pkg search php56 it shows up. Yes, I know that I should expect this in beta stages :)

    Thanks for your reply, Pfsense Support is awesome as always.

    cheers from Barcelona.


  • Administrator

    @josepgb:

    Thanks Jimp,

    already tried this, but console said that package was not available…

    also I did a pkg search php56 and that one did not popup...

    Now, in my rebuilded machine, if I do a pkg search php56 it shows up. Yes, I know that I should expect this in beta stages :)

    Thanks for your reply, Pfsense Support is awesome as always.

    cheers from Barcelona.

    I've added php56-mysql (which is now deprecated in PHP 7, also added php56-mysqli and php56-pdo_mysql which are better options. Consider to upgrade your code to use one of them.


Log in to reply