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

To enable php mysqli class support

Scheduled Pinned Locked Moved Captive Portal
5 Posts 2 Posters 970 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.
  • K
    kelvinmurik
    last edited by Nov 2, 2021, 1:19 PM

    How can i enable mysqli extension to overcome this error in captiveportal?

    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/etc/captiveportal_zone1.html:2 Stack trace: #0 /etc/inc/pfsense-utils.inc(2674): include() #1 /etc/inc/captiveportal.inc(2271): get_include_contents('/var/etc/captiv...') #2 /usr/local/captiveportal/index.php(295): portal_reply_page('', 'login', NULL, '98:fa:9b:92:36:...', '10.100.22.82') #3 {main} thrown in /var/etc/captiveportal_zone1.html on line 2 PHP ERROR: Type: 1, File: /var/etc/captiveportal_zone1.html, Line: 2, Message: Uncaught Error: Call to undefined function mysql_connect() in /var/etc/captiveportal_zone1.html:2 Stack trace: #0 /etc/inc/pfsense-utils.inc(2674): include() #1 /etc/inc/captiveportal.inc(2271): get_include_contents('/var/etc/captiv...') #2 /usr/local/captiveportal/index.php(295): portal_reply_page('', 'login', NULL, '98:fa:9b:92:36:...', '10.100.22.82') #3 {main} thrown
    
    G 1 Reply Last reply Nov 3, 2021, 11:44 AM Reply Quote 0
    • G
      Gertjan @kelvinmurik
      last edited by Gertjan Nov 3, 2021, 11:45 AM Nov 3, 2021, 11:44 AM

      @kelvinmurik

      Short : by installing the PHP mysqli extension.

      You can check the PHP settings used by visiting https://your-pfsense.your-place.tld/phpinfo.php

      c78f5ff6-4588-4179-a43f-5a9785add3f2-image.png

      There are two solution :
      Get the right package from the pfSense repositry (this is not a pfSEnse GUI package, ths is command line work using "pkd add ....", or,
      Just read here :

      d40a0559-e43e-4b87-a805-fd97eb1e43a4-image.png

      Install the FreeRadius pfSense GUI package, which will in turn install the needed MySQLi PHP extension (I guess - I have it - didn't check).

      I never installed this PHP extension manually, but I have the extension, as FreeRadius includes it (because it needs it).
      You don't have to actually use "FreeRadius".

      No "help me" PM's please. Use the forum, the community will thank you.
      Edit : and where are the logs ??

      1 Reply Last reply Reply Quote 0
      • K
        kelvinmurik
        last edited by Nov 4, 2021, 10:18 AM

        @gertjan said in To enable php mysqli class support:

        https://your-pfsense.your-place.tld/phpinfo.php

        The extension Mysqli shows that its already installed , but when i try a simple DB connection to a mysql server i get rhe error.
        i.e

        mysql_connect('xx.xx.xx.xx', 'user', 'pass','database')
        
        

        The Error

        Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/etc/captiveportal_zone1.html:2 Stack trace: #0 /etc/inc/pfsense-utils.inc(2674): include() #1 /etc/inc/captiveportal.inc(2271): get_include_contents('/var/etc/captiv...') #2 /usr/local/captiveportal/index.php(295): portal_reply_page('', 'login', NULL, '98:fa:9b:92:36:...', '10.100.22.82') #3 {main} thrown in /var/etc/captiveportal_zone1.html on line 2 PHP ERROR: Type: 1, File: /var/etc/captiveportal_zone1.html, Line: 2, Message: Uncaught Error: Call to undefined function mysql_connect() in /var/etc/captiveportal_zone1.html:2 Stack trace: #0 /etc/inc/pfsense-utils.inc(2674): include() #1 /etc/inc/captiveportal.inc(2271): get_include_contents('/var/etc/captiv...') #2 /usr/local/captiveportal/index.php(295): portal_reply_page('', 'login', NULL, '98:fa:9b:92:36:...', '10.100.22.82') #3 {main} thrown
        
        1 Reply Last reply Reply Quote 0
        • K
          kelvinmurik
          last edited by Nov 4, 2021, 10:57 AM

          Thanks alot i finally succeeded. It requires the updated driver mysqli instead of mysql that i was using earlier.😊

          G 1 Reply Last reply Nov 4, 2021, 11:25 AM Reply Quote 0
          • G
            Gertjan @kelvinmurik
            last edited by Nov 4, 2021, 11:25 AM

            @kelvinmurik

            Correct. "mysqli" requires "mysqli" support, which is different from the older "mysql" (-connect) library.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            5 out of 5
            • First post
              5/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received