This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 4

Localhost using a port number


  1. walterfaas
    Member

    Hello all,

    Just downloaded the 4.1 version, and see that it is still not possible to use a MySql server that needs a port number like: localhost:3155. This was also the case in the 3.5 version.

    So to get this working you need to change 3 files:

    upgrade.php (line 37)
    installer.php (line 30)
    includes/db-core.php (line 12)

    And change
    $dbh = new PDO('mysql:host='.MF_DB_HOST.';dbname='.MF_DB_NAME, MF_DB_USER, MF_DB_PASSWORD,
    $dbh = new PDO('mysql:host='.MF_DB_HOST.';port=3351;dbname='.MF_DB_NAME, MF_DB_USER, MF_DB_PASSWORD,

    Hope this is helpful for someone.

    greetz,
    walter

    Posted 9 years ago #
  2. yuniar

    Thanks for sharing this mod. However, actually you don't need to modify any file, simply include the port number as part of the database hostname.
    It should be something like this:

    define('MF_DB_HOST', 'localhost;port=3351');

    in case your mysql server require different socket, you can do this one as well:

    define('MF_DB_HOST', 'localhost;unix_socket=/tmp/mysql5.sock');

    MachForm Founder

    Posted 9 years ago #

RSS feed for this topic

Reply