PHP mysql captive portal



  • 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



  • 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





  • 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..


Log in to reply