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

    Running PHP, external database server connection

    Scheduled Pinned Locked Moved pfSense Packages
    3 Posts 2 Posters 3.8k 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.
    • N Offline
      NeophyteHeaven
      last edited by

      For some reason, i need to run php and connect to external database server. We have application server and also database server, i want to create log files where it saves something like squidquard log by user to their log report (Web Application host at Application Server) to let them know what they access to and reason it been blocked. The problem is, in pfsense, it seems i cant run php-mysql function such as mysql_connect(); This is for me to get connected to database external server. It always give me error..
      "Fatal error: Call to undefined function: mysql_connect() in /usr/local/www/connect.php on line 5"

      on my connect.php

      $sqluser = "user";
      $sqlpass = "pass";
      $server = "ip_address";
      mysql_connect($server,$sqluser,$sqlpass) or die("Could not connect to SQL server");
      mysql_select_db("database") or die("Could not select database from SQL server");

      running pfsense 1.2.3-RELEASE on Dell R300 (raid1), Lusca/LUSCA_HEAD r14560 patched by chudy r11

      1 Reply Last reply Reply Quote 0
      • E Offline
        esoteric
        last edited by

        We don't compile MySQL support into PHP on the pfSense builds.

        Erik Kristensen (pfS Dev)
        –---------------------
        Programmer, Interface Design, Network Security, Computer Forensics
        Certs: GCFA, Sec+, SFCP, RHCT, CEH

        1 Reply Last reply Reply Quote 0
        • N Offline
          NeophyteHeaven
          last edited by

          solved it using ozanus recommendation..http://forum.pfsense.org/index.php/topic,21885.msg112854.html#msg112854

          the important line is..

          pkg_add -r http://files.pfsense.org/packages/7/All/php4-mysql-4.4.8.tbz
          ln -s /usr/local/lib/php/20020429/mysql.so /usr/local/lib/php/extensions/no-debug-non-zts-20020429/mysql.so
          

          now im capturing user details like mac address via arp and squidquard..

          running pfsense 1.2.3-RELEASE on Dell R300 (raid1), Lusca/LUSCA_HEAD r14560 patched by chudy r11

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