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

    Fatal error: Call to undefined function mysql_connect()

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 3 Posters 3.1k 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.
    • P
      pedenski
      last edited by

      hi, i have uploaded a .php in the captive which uses a php function to call a remote mysql server

      mysql_connect("192.168.1.50", "root","admin") or die(mysql_error());
      echo "Connected to MySQL Server
      ";

      but it gives me

      Fatal error: Call to undefined function mysql_connect()

      can someone explain this to me pls. thanks

      1 Reply Last reply Reply Quote 0
      • C
        clart
        last edited by

        could be you do not have mysql installed?
        run this command and see what you get;
        pkg_info | grep mysql

        1 Reply Last reply Reply Quote 0
        • M
          michel2013
          last edited by

          I had the same problem here.

          output of pkg_info | grep mysql is:
          mysql-client-5.5.21 Multithreaded SQL database (client)
          mysql-server-5.5.21 Multithreaded SQL database (server)

          After running:
          touch /etc/php_dynamodules/mysql
          /etc/rc.php_ini_setupphp -m | grep mysql

          mysql
          mysqlnd

          /etc/rc.restart_webgui

          No result. But when I restart the webconfigurator bij the menu (option 11)  phpinfo() gives me a positive

          I guess a bug

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