Installing Mantis on IIS 7 with PHP 5.3 andMSSQL-Server 2008

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
Bernd
Posts: 4
Joined: 03 Jun 2011, 17:56
Location: Eschwege, Germany
Contact:

Installing Mantis on IIS 7 with PHP 5.3 andMSSQL-Server 2008

Post by Bernd »

Hi folks,

since I did not find a proper solution anywhere I did some research last night to get Mantis to work with IIS and SQL-Server 2008. After a lot of code tracking I finally came up with just a few code changes...

1. The SQL-Script generated by the installer does not work out, since it contains old "CREATE TABLE" instructions and all the historical changes over the last versions. The biggest problem ist that it generates DATETIMES with a default value and then tries to change them to INT... Use the SQL-Script from the attached zip instead and you'll be fine!
2. As mssql is not supported for PHP5.3 the best way to acces MSSQL-Server from PHP is SQLServerDriver_ForPHP20 from Microsoft http://www.microsoft.com/downloads/en/d ... ae6cf2ca05
3. Replace the two database API PHP-Pages in your Mantis web folder with the ones from the attached zip
4. change your config_inc.php to

Code: Select all

	$g_session_validation = ON;

	$g_hostname = '192.168.1.100'; //IP of your MSSSQL-Server
	$g_db_type = 'mssqlnative';
	$g_database_name = 'Mantis';
	$g_db_username = 'user';
	$g_db_password = 'password';
Test-Configuration:
Windows Server 2008 Web-Edition, with IIS 7.0 and PHP-5.3.2-nts-Win32-VC9-x86
SQLServerDriver for PHP 2.0
MSSQL-Server 2008
Mantisbt-1.2.5

Just in case there are any further database issues that I did not find yet: Please let me know! I have left a debug output in adodb-mssqlnative.inc.php (line 477) that reports the failed query so you can run it against the database within SQL-Server-Management-Studio to see what is wrong...

Have fun! :)

Bernd
Attachments
Mantis_Changes_for_MSSQL2008.zip
(26.71 KiB) Downloaded 1220 times
atrol
Site Admin
Posts: 8562
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Installing Mantis on IIS 7 with PHP 5.3 andMSSQL-Server

Post by atrol »

Thank you very much for this contribution.
Would be great if you find some time to add notes to the open issues which are related to MSSQL

Code: Select all

http://www.mantisbt.org/bugs/search.php?project_id=1&category=db%20mssql&status_id[]=10&status_id[]=20&status_id[]=30&status_id[]=40&status_id[]=50&sticky_issues=off&sortby=last_updated&dir=DESC&hide_status_id=-2
Please use Search before posting and read the Manual
Bernd
Posts: 4
Joined: 03 Jun 2011, 17:56
Location: Eschwege, Germany
Contact:

Re: Installing Mantis on IIS 7 with PHP 5.3 andMSSQL-Server

Post by Bernd »

I'd love to, but there are so many of them... :wink:

In fact I did not find a suitable way to post my code directly to the developers... it can be merged within minutes because I changed around ten lines of code...
I simply added "mssqlnative" to every database-sitch-case and changed the identity-query in mssqlnative to @@IDENTITY

However, the SQL-Script is the main issue but it will probably work from scratch if it is clean up (instead of creating an old database scheme and alter it a thousand times) :wink:
raul_ribeiro
Posts: 2
Joined: 07 Jun 2011, 14:28

Re: Installing Mantis on IIS 7 with PHP 5.3 andMSSQL-Server

Post by raul_ribeiro »

Hi,

Thanks for your tips: )

I have a different installation, i'm running PHP 5.2.14 and i have no issue with sql server communication.
So I used your script in the database but i got some error due to the date format
i changed your code withe some of mine , as following

your code:
INSERT INTO mantis_user_table(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', '22.05.2011 20:18:26', '22.05.2011 20:18:26', '1', '0', 90, 3, 0, 0, '67c69e32e09ff0e0ab2f8414d850401e9adad23067167f24d61502a59014ad7e');
My changes

IINSERT INTO mantis_user_table(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', 1, 1, '1', '0', 90, 3, 0, 0, '43c90a58b766eca71a4eaec08120f1b51fec152d8f4d2c0cfec26390ed94f575');



it went smoothly except when I get into the login screen the following happens ;


1) first i get a APPLICATION WARNING #user_get_field() for NO_USER: in the login page
2) I cannot login into the app as a bad password or user not activated

Coul you please help me ?
raul_ribeiro
Posts: 2
Joined: 07 Jun 2011, 14:28

Re: Installing Mantis on IIS 7 with PHP 5.3 andMSSQL-Server

Post by raul_ribeiro »

Sorry, bad copy & past

My code


INSERT INTO mantis_user_table(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
('administrator', '', 'root@localhost', '63a9f0ea7bb98050796b649e85481845', 1, 1, '1', '0', 90, 3, 0, 0, '43c90a58b766eca71a4eaec08120f1b51fec152d8f4d2c0cfec26390ed94f575');
Post Reply