MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Moderators: Developer, Contributor
-
AddedValue
MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Windows Server 2008 R2:
Installed IIS 7.5 - check "CGI" feature
Installed PHP 5.3.9 (or 5.3.10)
Installed PHP Manager for IIS (codeplex site, x86 or x64!)
Installed SQL Server 2008 R2 (enable .NET Framework Core role via Add Features .NET 3.5.1)
Installed MSSQL drivers for PHP (SQLSRV20) (SQLSRV30 doesn't work with me)
Enabled those drivers with PHP Manager for IIS (Visible in IIS Manager)
Extracted Mantis files to wwwroot
Created a Mantis Database called Mantis on SQL Server 2008 R2 with the added .sql file (rename)
Create a database user and hook it up to the database (with read/write) rights
Not needed, check out one of the newer posts in this topic to use SQL access without ODBC.
Created a System DSN entry with the 32bit ODBC console (SysWOW64 folder) called MantisDSN
Changed the database section of config_inc.php to point to the odbc entry:
# --- Database Configuration ---
$g_hostname = 'MantisDSN';
$g_db_username = 'dbuserwithmantisaccess';
$g_db_password = 'passwordofdbuserwithmantisaccess';
$g_database_name = 'mantis';
$g_db_type = 'odbc_mssql';
Empty browser cache from previous failed attempts
Browse to http://localhost/mantis (your equivalent)
Installed IIS 7.5 - check "CGI" feature
Installed PHP 5.3.9 (or 5.3.10)
Installed PHP Manager for IIS (codeplex site, x86 or x64!)
Installed SQL Server 2008 R2 (enable .NET Framework Core role via Add Features .NET 3.5.1)
Installed MSSQL drivers for PHP (SQLSRV20) (SQLSRV30 doesn't work with me)
Enabled those drivers with PHP Manager for IIS (Visible in IIS Manager)
Extracted Mantis files to wwwroot
Created a Mantis Database called Mantis on SQL Server 2008 R2 with the added .sql file (rename)
Create a database user and hook it up to the database (with read/write) rights
Not needed, check out one of the newer posts in this topic to use SQL access without ODBC.
Created a System DSN entry with the 32bit ODBC console (SysWOW64 folder) called MantisDSN
Changed the database section of config_inc.php to point to the odbc entry:
# --- Database Configuration ---
$g_hostname = 'MantisDSN';
$g_db_username = 'dbuserwithmantisaccess';
$g_db_password = 'passwordofdbuserwithmantisaccess';
$g_database_name = 'mantis';
$g_db_type = 'odbc_mssql';
Empty browser cache from previous failed attempts
Browse to http://localhost/mantis (your equivalent)
- Attachments
-
- Mantis128onMSSQL.zip
- Place these files in the CORE directory
- (13.45 KiB) Downloaded 1831 times
-
- Mantis128MSSQLsql.txt
- (22.54 KiB) Downloaded 1349 times
Last edited by AddedValue on 28 Mar 2012, 13:47, edited 4 times in total.
-
AddedValue
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Just for convenience:
SQL Server 2008 R2 with Management Tools: http://go.microsoft.com/fwlink/?LinkId= ... lcid=0x409
PHP Manager for IIS x64: http://phpmanager.codeplex.com/releases ... oad/253209
SQL Server drivers for PHP: http://www.microsoft.com/download/en/de ... x?id=17308
Don't forget enable (local) database users (the Mantis user) in SQL Server Management Studio.
Use the odbcad.exe in the SysWoW64 folder to create a 32bit ODBC SystemDSN for PHP.
SQL Server 2008 R2 with Management Tools: http://go.microsoft.com/fwlink/?LinkId= ... lcid=0x409
PHP Manager for IIS x64: http://phpmanager.codeplex.com/releases ... oad/253209
SQL Server drivers for PHP: http://www.microsoft.com/download/en/de ... x?id=17308
Don't forget enable (local) database users (the Mantis user) in SQL Server Management Studio.
Use the odbcad.exe in the SysWoW64 folder to create a 32bit ODBC SystemDSN for PHP.
-
Hockeytown
- Posts: 21
- Joined: 28 Oct 2010, 18:08
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
I followed these steps in our test environment and it setup nicely but is throwing the following error once logged in and Clicking the Summary tab:
APPLICATION ERROR #401
Database query failed. Error received from database was #0: [Microsoft][ODBC SQL Server Driver]Invalid parameter number for the query: SELECT b.id, b.date_submitted, b.last_updated, MAX(h.date_modified) as hist_update, b.status
FROM mantis_bug_table b LEFT JOIN mantis_bug_history_table h
ON b.id = h.bug_id AND h.type=0 AND h.field_name='status' AND h.new_value=?
WHERE b.status >=? AND 1<>1
GROUP BY b.id, b.status, b.date_submitted, b.last_updated
ORDER BY b.id ASC.
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
Looks like the Date/Time issue with PHP and MSSQL. Any help on getting this resolved would be appreciated.
APPLICATION ERROR #401
Database query failed. Error received from database was #0: [Microsoft][ODBC SQL Server Driver]Invalid parameter number for the query: SELECT b.id, b.date_submitted, b.last_updated, MAX(h.date_modified) as hist_update, b.status
FROM mantis_bug_table b LEFT JOIN mantis_bug_history_table h
ON b.id = h.bug_id AND h.type=0 AND h.field_name='status' AND h.new_value=?
WHERE b.status >=? AND 1<>1
GROUP BY b.id, b.status, b.date_submitted, b.last_updated
ORDER BY b.id ASC.
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
Looks like the Date/Time issue with PHP and MSSQL. Any help on getting this resolved would be appreciated.
-
AddedValue
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Needed a few more steps and some (backporting from 1.3.0) to fix:
The three files (attachments) need to be added to the "core" directory in Mantis (fixing some SQL statements).
We need the SQLSRV20 driver http://www.microsoft.com/download/en/de ... x?id=20098 from Microsoft if we want true mssqlnative to work, without odbc hack.
Extract to "C:\Program Files (x86)\PHP\ext" or something similar (use elevated privileges, eg run as administrator).
Ofcourse you'll need to enable the files with the PHP Manager for IIS (and disable the other ones).
To adjust the settings we can actually fix the 'config_inc.php' when adding the following:
# --- Database Configuration ---
$g_hostname = 'sqlserver\database';
$g_db_username = 'mantisdbuser';
$g_db_password = 'mantisdbuserpassword';
$g_database_name = 'mantis';
$g_db_type = 'mssqlnative';
And you can ditch the odbc dsn entry now
The three files (attachments) need to be added to the "core" directory in Mantis (fixing some SQL statements).
We need the SQLSRV20 driver http://www.microsoft.com/download/en/de ... x?id=20098 from Microsoft if we want true mssqlnative to work, without odbc hack.
Extract to "C:\Program Files (x86)\PHP\ext" or something similar (use elevated privileges, eg run as administrator).
Ofcourse you'll need to enable the files with the PHP Manager for IIS (and disable the other ones).
To adjust the settings we can actually fix the 'config_inc.php' when adding the following:
# --- Database Configuration ---
$g_hostname = 'sqlserver\database';
$g_db_username = 'mantisdbuser';
$g_db_password = 'mantisdbuserpassword';
$g_database_name = 'mantis';
$g_db_type = 'mssqlnative';
And you can ditch the odbc dsn entry now
- Attachments
-
- Mantis128onMSSQL.zip
- (13.45 KiB) Downloaded 957 times
Last edited by AddedValue on 28 Mar 2012, 13:18, edited 2 times in total.
-
Hockeytown
- Posts: 21
- Joined: 28 Oct 2010, 18:08
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Using this format $g_hostname = 'sqlserver\database'; gave me this error:
APPLICATION ERROR #400
Database connection failed. Error received from database was #-1: SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
SQLState: HYT00
Error Code: 0
Message: [Microsoft][SQL Server Native Client 10.0]Login timeout expired
SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
SQLState: HYT00
Error Code: 0
Message: [Microsoft][SQL Server Native Client 10.0]Login timeout expired
SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
Changing to this format $g_hostname = 'sqlserver'; I am facing this error:
APPLICATION ERROR #400
Database connection failed. Error received from database was #18456: SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
mantisbt is the SQL user I created and granted it DBO rights to the MantisBT DB I created in MSSQL and it was working before.
APPLICATION ERROR #400
Database connection failed. Error received from database was #-1: SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
SQLState: HYT00
Error Code: 0
Message: [Microsoft][SQL Server Native Client 10.0]Login timeout expired
SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]SQL Server Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
SQLState: HYT00
Error Code: 0
Message: [Microsoft][SQL Server Native Client 10.0]Login timeout expired
SQLState: 08001
Error Code: -1
Message: [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
Changing to this format $g_hostname = 'sqlserver'; I am facing this error:
APPLICATION ERROR #400
Database connection failed. Error received from database was #18456: SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
SQLState: 28000
Error Code: 18456
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'mantisbt'.
mantisbt is the SQL user I created and granted it DBO rights to the MantisBT DB I created in MSSQL and it was working before.
-
AddedValue
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
What client protocols do you have enabled in SQL Native Client 10.0 Configuration in the Sql Server Configuration Manager.
Well, I believe the new files should work with the ODBC connection as well (the files just fix some SQL statements).
Well, I believe the new files should work with the ODBC connection as well (the files just fix some SQL statements).
-
Hockeytown
- Posts: 21
- Joined: 28 Oct 2010, 18:08
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Attached is a snapshot of the Protocols enabled on the SQL Native Client 10.0 Configuration
I also tried reverting back to the ODBC and DSN setup and got the same results as before the 3 new files were added.
I also tried reverting back to the ODBC and DSN setup and got the same results as before the 3 new files were added.
- Attachments
-
- SQL Native Client 10 Protocols.gif (7.14 KiB) Viewed 49409 times
-
Hockeytown
- Posts: 21
- Joined: 28 Oct 2010, 18:08
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Ahem.... What I am about to do is very painful. Your fix works just fine it's my brain that may need some work. I was trying to connect to the wrong SQL DB.... DOH!!
After I caught my mistake and changed it things are working and testing can begin.
-
AddedValue
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Happy to know that you made it work as well!
I might have skipped some small steps in my small how-to but glad to know you made it work as well.
I might have skipped some small steps in my small how-to but glad to know you made it work as well.
-
Hockeytown
- Posts: 21
- Joined: 28 Oct 2010, 18:08
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
So testing has begun and after creating a test issue to report and assigning it when clicking on the bug link, either from email or directly inside Mantis the following error is thrown:
APPLICATION ERROR #401
Database query failed. Error received from database was #102: SQLState: 42000
Error Code: 102
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near ')'.
for the query: SELECT id, name, description FROM mantis_tag_table WHERE id IN ( ) ORDER BY name ASC .
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
APPLICATION ERROR #401
Database query failed. Error received from database was #102: SQLState: 42000
Error Code: 102
Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near ')'.
for the query: SELECT id, name, description FROM mantis_tag_table WHERE id IN ( ) ORDER BY name ASC .
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
-
AddedValue
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
It it an URL in the likes of:
http://localhost/mantis/view.php?id=3
If that is the case, I can't reproduce it in my setup.
http://localhost/mantis/view.php?id=3
If that is the case, I can't reproduce it in my setup.
-
Hockeytown
- Posts: 21
- Joined: 28 Oct 2010, 18:08
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
What can I get you to help troubleshoot this error? Seems to be an issue with the SQL query:
SELECT id, name, description FROM mantis_tag_table WHERE id IN ( ) ORDER BY name ASC
What is supposed to be happening in the part of the query I have highlighted above?
SELECT id, name, description FROM mantis_tag_table WHERE id IN ( ) ORDER BY name ASC
What is supposed to be happening in the part of the query I have highlighted above?
-
Hockeytown
- Posts: 21
- Joined: 28 Oct 2010, 18:08
Re: MSSQL2008R2/IIS7.5/PHP5.3.9 Working
Can anyone help out with this?