Jump to content
X2Community Forums

Recommended Posts

We have been working on another install of X2 and have run into a head scratcher.  This is the first time on this particular host, but we were able to get past the requirements script and set things up so we can run the install.

 

But, we can not connect to host with the proper credentials.

 

The host is an IP:PORT (non-standard port)

 

All other credentials are correct and nothing abnormal.

 

Any thoughts?

 

Will X2 connect to a non standard port?

 

Best,

 

Frank

Link to post
Share on other sites

Hello Frank,

 

I find it interesting this use case hasn't been encountered yet, but right now the app cannot be configured to use MySQL on a non-standard port.

 

However, you can directly modify the install script and your configuration to account for this. Just before installing, modify initialize.php (don't worry, this file is deleted anyway) around line 169 and append your port assignment to the PDO connection string:

$con = new PDO("mysql:host={$_POST['dbHost']};dbname={$_POST['dbName']};port=3307", $_POST['dbUser'], $_POST['dbPass'], array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));

Proceed to install. Afterward, you will need to modify your config at protected/config/main.php and update the PDO connection string:

'db' => array(
    'connectionString' => "mysql:host=$host;dbname=$dbname;port=3307",
    /* ... */
),

Raymond

Link to post
Share on other sites

Hey Raymond,

 

Yes, it is very interesting for sure with such a large install base.  I was already digging into the code to find this.  You have saved me valuable time.  The mod of main.php would have hung me up anyway.

 

I'll give it a run this morning and hit you back.

 

NON-STANDARD PORT

 

Best,

 

Frank

Link to post
Share on other sites

Frank,

 

Hmm, interesting the connection test passed. Please double-check your PDO strings. Also, have you already created the database for this user to use and granted sufficient privilege?

You may be better off performing a command line install. After modifying the PDO strings, edit the file installConfig.php and set your database, user, password, and admin user/pass/email combination, then execute `php initialize.php silent` to install.

 

Raymond

Link to post
Share on other sites

Yes, I have done many of these installs.  So, the database is created and permissions are set accordingly.

 

I only altered one new PDO as instructed in initialize.php script.  What other strings do I need to alter?  Trying line 838 (approx) as well.  Will report.

 

Best,

 

Frank

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...