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

    PDO for MySQL is not working on Captive Portal on PfSense 2.4.4

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 2 Posters 795 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.
    • E
      emjhay
      last edited by

      It seems that PDO for MySQL is not working on Captive Portal on PfSense 2.4.4.

      I am using FreeRADIUS with MySQL as authentication database on PfSense 2.4.4. MySQL database is hosted on another server.

      This is the error:

      Fatal error: Uncaught PDOException: could not find driver in /var/db/cpelements/PHPFILE Stack trace: #0 /var/db/cpelements/PHPFILE PDO->__construct('mysql:host=...) #1 {main} thrown in /var/db/cpelements/PHPFILE
      
      1 Reply Last reply Reply Quote 0
      • E
        emjhay
        last edited by

        I solved my problem by using the following:

        To search the php modules type this in the shell console

        pkg search php
        

        To install the pdo_mysql module type this in the shell console

        pkg install php72-pdo_mysql-7.2.10
        

        The pdo_mysql module is version specific, if you have a higher or you have updated php the module name may have changed depending on the php version you have in pfSense.

        The installed pdo_mysql module is from pfSense 2.4.4 which consist of php version 7.2.10.

        1 Reply Last reply Reply Quote 1
        • jane.doe2J
          jane.doe2
          last edited by

          Same for mysqli :)

          pkg install php72-mysqli-7.2.10
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.