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

    PHP mysql captive portal

    Scheduled Pinned Locked Moved Development
    4 Posts 4 Posters 6.0k 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
      kyleh0000
      last edited by

      Hi All,

      Im trying to write a custom php login page for the captive portal, so far all is going well. however I'm up to the point where i want to connect to a mysql database running on another box.

      The error message I get is "Call to undefined function mysql_connect()" I'm going to assume this is because php within pfsense does have the mysql extension enabled.

      I did notice that the mysql.so extension is there on the OS but I'm having problems getting php to recognize that it is able to use it, I have added the line

      extension=mysql.so

      to my php.ini file and made sure that the mysql.so file is located in the extension_dir of the php.ini file

      however this setting gets removed after each reboot, how do i keep this file after each reboot?

      I have tried editing it in the webgui but it still will not stick at each reboot

      im not even sure if this will allow me to use the mysql commands in my webpage but I hope so as it will let me do some pretty cool stuff with my portal login.

      I found this post from ages ago….

      http://forum.pfsense.org/index.php?topic=3234.0

      which gave me a starting point, but just to note i did NOT install mysql on pfsense I simply installed snort which has the mysql-client package which gave me the mysql.so extension

      any help is much appreciated!

      Thanks

      1 Reply Last reply Reply Quote 0
      • A
        asdavey
        last edited by

        I had to do something similar but to enable json support.

        /usr/local/etc/php.ini gets overridden on every reboot.

        You need to modify /etc/rc.php_ini_setup and add the mysql extension there (though the syntax is a little different).

        HIH

        Andy

        1 Reply Last reply Reply Quote 0
        • marcellocM
          marcelloc
          last edited by

          try this:

          http://forum.pfsense.org/index.php/topic,42031.msg217061.html#msg217061

          Treinamentos de Elite: http://sys-squad.com

          Help a community developer! ;D

          1 Reply Last reply Reply Quote 0
          • yakarY
            yakar
            last edited by

            you can try this (in turkish forums):

            http://forum.pfsense.org/index.php/topic,41243.0.html

            maybe you need change freebsd package name in url..

            Bilgi paylaştıkça artar!
            5651 sayılı kanun (güncel)
            pfSense alt yapısı üzerine kurulu iSafe ile işletmelere özel çözümler.

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