Roundcube Community Forum

 

Issue: Trouble with Roundcube installer & MSSQL 2016

Started by thefid, March 04, 2017, 03:59:18 PM

Previous topic - Next topic

thefid

I suspect the issue is with the following section as I no longer have any "Not OK" lines...

Checking available databases
Check which of the supported extensions are installed. At least one of them is required.

MySQL:  NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-mysql.php)
PostgreSQL:  NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-pgsql.php)
SQLite:  NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-sqlite.php)
SQLite (v2):  NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-sqlite.php)
SQL Server (SQLSRV):  NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-sqlsrv.php)
SQL Server (DBLIB):  NOT AVAILABLE(See http://www.php.net/manual/en/ref.pdo-dblib.php)
Oracle:  NOT AVAILABLE(See http://www.php.net/manual/en/book.oci8.php)

Everything else on the Installer page is OK, yet I still get the error message:

Sorry but your webserver does not meet the requirements for Roundcube!
Please install the missing modules or fix the php.ini settings according to the above check results.
Hint: only checks showing NOT OK need to be fixed.

EDIT to clarify: Using Windows SQL Server 2016 and PHP 7.1

SKaero


thefid

Quote from: SKaero on March 04, 2017, 04:31:31 PM
You need to have the PHP SQLSRV PDO driver http://php.net/manual/en/ref.pdo-sqlsrv.php to be able to connect to MSSQL.

I installed version 4.0 of the drivers you suggested and added the following lines to the ini file:
extension=php_sqlsrv_7_ts.dll
extension=php_mssql.dll
extension=msql.dll

None of those made any difference on the installer test page. I also checked the ext location for the appropriate dll files.



SKaero

Do you have the PHP PDO driver installed?
Did you restart PHP after you installed the drivers?

thefid

Yes, I did restart PHP. I even restarted the machine.

The MS download had about 8 PDO related extensions available. I only added the extensions listed above in hopes it would work. Should I add all of the DLL files added by Microsoft's download?

SKaero

There should be one called something like php_pdo.dll which is the base of the PDO system and needed to run any of the drivers.

thefid

I have attached a directory list of files. I do not have a php_pdo.dll, however we do have a few other options.

SKaero

Looking at the documentation http://php.net/manual/en/pdo.installation.php it appears since PHP 5.3 you don't need the php_pdo.dll anymore. You'd want one of the php_pdo_sqlsrv_*.dll drivers, based on the documentation http://php.net/manual/en/ref.pdo-sqlsrv.php

If you are running non-thread-safe PHP (PHP 5.3), use the php_pdo_sqlsrv_53_nts.dll file. (You should use a non-thread-safe version if you are using IIS as your web server). If you are running thread-safe PHP, use the php_pdo_sqlsrv_53_ts.dll file. Similarly for PHP 5.4, use the php_pdo_sqlsrv_54_nts.dll or php_pdo_sqlsrv_54_ts.dll depending on whether your PHP installation is non-thread-safe or thread-safe.

thefid

With help of the suggestions here, I think I decoded the driver file names downloaded from Microsoft.

There were 8 drivers added to the extensions, 4 were not PDO, while 4 were. Of those 4 PDO, 2 were for x86 and 2 for x64. Of those 2 for my 64 bit OS, one is for Non-Thread Safe (NTS) while the other is TS. Based on this, I really only have 1 driver which is applicable.

So I added the DLL extension in the INI file and still no success. I am still not seeing any listed SQL driver in the Roundcube installer page.

SKaero

Hmm, well I'm out of ideas. I'm not a Windows guy so you may get a better response on a Windows forum since this isn't really a Roundcube specific question.

fluxnull

SKaero I can get you a little further.

If you're using IIS you need to use the non thread safe version of PHP. I was doing testing on Windows 10 Pro x64, IIS, with PHP 7.1 x64 (Non Thread Safe), and MSSQL 2016 Express(ODBC 13). 

These PDO drivers work.
https://github.com/Microsoft/msphpsql/releases

Specifically
https://github.com/Microsoft/msphpsql/releases/tag/4.1.5-Windows
7.1 Driver

Place the drivers in your extension directory specified in the php.ini and add the following entries to your php.ini

extension=php_sqlsrv_71_nts.dll
extension=php_pdo_sqlsrv_71_nts.dll

Then the SQL Server (SQLSRV) will become available and the installer script will flag it as OK, however when testing the config (step 3) I kept getting issue with the roundcube installer script saying that the database was not initialized. throwing an ODBC 13 error I would provide it but I dont actively have it accessible at the moment that I'm writing this.  I tried running the database creation (.sql) script directly on the server hoping that would initialize the database appropriately.

As far as SQL is concerned I created a separate user for running roundcube exclusively. Setting both owner and dbcreator permissions for the roundcube database initially. Later in a vain effort to get it working I temporarily granted it sysadmin to no avail as a test.

Then I though perhaps the PDO driver was not working or installed correctly. So i tested it with a small PHP script to connect and return records from a database this worked without issue so it seems to be something particular to roundcubes installer script where it is failing.

One thing i will mention is when i added the extensions at the time i personally only add "extension=php_pdo_sqlsrv_71_nts.dll" however I've done some additional reading and found that its advised to add both as I mentioned above if you try this and find success let me know otherwise I will likely be testing this this weekend myself.







thefid

Thank you, I had wondered if there was a PHP version specific driver. That did the trick and I can get to step 3.

I did install both drivers. This link explains how:
https://msdn.microsoft.com/en-us/library/cc296203.aspx

I am now having issues with the DB user logging in (Windows Authentication VS SQL Server). I will work on that and let you know.

thefid

I had permission issues with the SQL server on Step 3, I resolved it by creating a user from the Root SQL Server and then going to the DB to give that user security access. Once I did that, it fixed my permission denied issue.

Thanks for everyone's help!

SKaero

Glad that you where able to figure out the problem. Hopefully this thread will be useful to anyone else who is trying to setup Roundcube with MSSQL.