Netgate SG-1000 microFirewall

Author Topic: Latest update left PFSENSE without php-mysql support  (Read 905 times)

0 Members and 1 Guest are viewing this topic.

Offline josepgb

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Latest update left PFSENSE without php-mysql support
« on: January 20, 2016, 05:04:15 am »
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

Online maverick_slo

  • Hero Member
  • *****
  • Posts: 761
  • Karma: +32/-2
    • View Profile
Re: Latest update left PFSENSE without php-mysql support
« Reply #1 on: January 20, 2016, 07:07:28 am »
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

Offline josepgb

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Latest update left PFSENSE without php-mysql support
« Reply #2 on: January 20, 2016, 07:21:14 am »
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!


Online jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 20323
  • Karma: +1221/-8
    • View Profile
Re: Latest update left PFSENSE without php-mysql support
« Reply #3 on: January 20, 2016, 07:43:48 am »
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:

Code: [Select]
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.
« Last Edit: January 20, 2016, 07:47:52 am by jimp »
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline josepgb

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Latest update left PFSENSE without php-mysql support
« Reply #4 on: January 20, 2016, 08:25:54 am »
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.

Offline Renato Botelho

  • Administrator
  • Full Member
  • *****
  • Posts: 248
  • Karma: +40/-0
    • View Profile
Re: Latest update left PFSENSE without php-mysql support
« Reply #5 on: January 20, 2016, 11:35:56 am »
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.
Renato Botelho