Trouble Installing Mantis on my PC(IIS5)

Get help from other users here.

Moderators: Developer, Contributor

peterlow
Posts: 9
Joined: 11 Apr 2005, 07:45

Trouble Installing Mantis on my PC(IIS5)

Post by peterlow »

I am a new Mantis User. and also New to MySQL and Php.
I had downloaded and install "PHP 5.0.4" onto my IIS5 Server on WinXP.
I also had downloaded and install MySQL Server onto my PC.
And also Mantis.
.
I created a Virtual Directory to the Mantis Program on my IIS and run the application from the IE Browser ( http://localhost/mantis/main_page.php )

However, it return me an error

Fatal error: Call to undefined function mysql_connect() in
D:\Project\WebApplication\Bug Tracking System\Mantis\mantis-0.19.2
\core\adodb\drivers\adodb-mysql.inc.php on line 338

And i believe this is due to the database structure is not created at the My SQL and also the connection string from the Mantis PHP program to the MySQL is also not set properly.

I downloaded the Mantis Manual (D:\Project\WebApplication\Bug Tracking System\Mantis\Manual\manual\index.html) ,
but does not see any portion that mentioned abt the MySQL Database Structure for Mantis as well as the database connection frm the Mantis PHP application to the MySQL server?

Can any one here advise me how can this be done?? or where can i refer to on the manual on this area???
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

Hi Peterlow,

A few things:

Firstly, as far as I know, Mantis still does not fully support (or is not fully supported by, whichever way you wish to look at it) PHP 5.

Secondly, the mysql_connect error means that PHP does not currently have the MySQL extension installed. You will have to check out the PHP documentation at php.net to work that out (I believe the default support changed for PHP 5).

Thirdly, to set up the database in the first place you need to run the MySQL script from mantis/sql/db_generate.sql . This sets you up with a default administrator account with the username of 'administrator' and 'root' as your password.

Hope this helps: once you've got MySQL working with PHP, you should be away...

Lincoln.
Guest

Post by Guest »

Hi Lincoln.

thks for advising. SOme more questions that need further advise.

i) I had uninstall PHP5 and install PHP 4.3.11
so i guess this will solve it

ii) I cannot find any MySQL extension for download in http://www.MySQL.com
website.
Can i download and installed this extension??

iii) What is the command line to run the script for MySQL??
mantis/sql/db_generate.sql

ON my PC, it is being defaulted to MsSQL Server script instead??
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

OK: let's get PHP and MySQL working first. I will try and go fairly basically so please forgive me if it's too basic. At the same time, please forgive me if it's not basic enough... we'll work out the balance soon enough :)

Firstly, we need to make sure that PHP has MySQL support set up. The easiest way to tell this, I reckon, is to create a simple PHP script (the always useful 'phpinfo.php' script):

<?php
phpinfo();
?>

Dump those three lines into a file called phpinfo.php somewhere in your server and then hit that file with a browser. You should now see a long page with a heap of information regarding your PHP installation. If you find a table headed 'mysql', you have the MySQL extension installed and running (assuming, I guess, there are no errors listed there).

If you do not, then I would suggest checking out http://forums.winforums.org/showthread. ... 414&page=3 . While trying to get all of the details you would need, this seemed to answer most of the things I could think of. Just ignore the stuff relating to PHP5 (you're after the information on php_mysql.dll, libmysql.dll / libmysqli.dll).

In theory, this is a PHP thing so I daresay if you are having any problems you will get more help from php.net than from mysql.com.

When you think you've got PHP / MySQL working, check the phpinfo.php script again. That will tell you pretty quickly :)


Now, to setting up the actual database. I can only give you a bit of an overview here as I do all of my actual MySQL work through phpMyAdmin ( http://www.phpmyadmin.net ). I will assume you have a user named 'root' with an empty password and that you are doing this all on the actual server (localhost). Also in the following you will see that I use 'database_name': you should use whatever you want your database to be called.

1) Connect to your server: in your MySQL installation there should be a 'bin' subdirectory. From that directory, from the command line, type:
mysql -u root

You should now see a 'mysql>' prompt. This means that you are connected to the localhost server. All of the following need to be done from this prompt.

2) Drop the database: just in case, let's start afresh. Type:
D ROP DATABASE `database_name`;

You should get an error if it didn't exist, otherwise a message saying 'Query OK'.

3) Create the database: Type:
CREATE DATABASE `database_name`;

You should get a message saying 'Query OK'.

4) Switch to the freshly created database: Type:
USE database_name;

You should get a message saying 'database changed'.

5) Populate the database: this is where you create the database structure and where the db_generate.sql file comes into it. Note that you will need to replace the '/path/to/wwwroot' with the actual path to your web server directory (as in, where you have the Mantis directory installed to). Type:
source /path/to/wwwroot/mantis/sql/db_generate.sql;

You should get quite a few 'Query OK' messages.

6) Exit the MySQL client: Type:
quit;

There: you should now have the MySQL database set up.

If you're having problems connecting to the actual MySQL server then I'm not really able to help you (it's a little out of my area) and I would suggest hitting the MySQL forums.


I don't quite know what you mean by your PC defaulting to the MSSQL script: hopefully by following the above instructions you shouldn't have that problem anymore.


Hopefully we're on our way to having you sorted out!
Lincoln.
peterlow
Posts: 9
Joined: 11 Apr 2005, 07:45

Post by peterlow »

Hi Lincoln:

thanks. It is indeed very helpful.

(i)
the phpInfo() method of verifying the the MySQL Extension has work on my PC.


(ii)
As for the 6 steps for setting the Mantis "MySQL" database in PHP, i hit some trouble after completed the setting :-

the "db_generate.sql" is stored in the folder :--
"D:\Mantis\mantis-0.19.2\sql"

so in the MySQL command line, i run :-
mysql>source D:\Mantis\mantis-0.19.2\sql\db_generate.sql

And the Generate script run fine. I open up the MySQL Control Center
and indeed the Database and tables are successfully created for Mantis.


But when i run the Web Application in IE as follows :-
http://localhost/mantis/main_page.php

it give me an error page, as follows ::----

-------------------------------------------------------------------------------

APPLICATION ERROR #400
Database connection failed. Error received from database was #1049: Unknown database 'bugtracker'

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.



-------------------------------------------------------------------------------

help???
:<
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

OK this looks more like just a simple configuration error.

The way the configuration works in Mantis is to first look at config_defaults_inc.php to get the default settings, then look at config_inc.php (which doesn't even exist by default) to find any override settings. This is a great little system as now when you upgrade you just copy over the files and your customised configuration file (config_inc.php) doesn't get affected, while still getting any new default configuration settings from the upgraded config_defaults_inc.php.

So basically you need to create a config_inc.php file that sets any variables that are different from the defaults in config_defaults_inc.php.

Although you would want to go through the entire default file to make sure you get everything exactly how you want it, I daresay right now you just want to see something :)

There are 5 configuration settings that you will (might?) need to worry about, so easiest thing to do is copy the following 7 lines into a new file called config_inc.php in the directory where you will be running Mantis from:

<?php
$g_hostname = 'localhost';
$g_port = '';
$g_db_username = 'root';
$g_db_password = '';
$g_database_name = 'database_name';
?>

Naturally, change the database name variable to equal whatever you called the database, and change the database username and password if need be.

Also, make sure there is no whitespace (not even a newline) before or after the <?php / ?> tags.

Hopefully we're getting there...
Lincoln.
peterlow
Posts: 9
Joined: 11 Apr 2005, 07:45

Post by peterlow »

hi

I got my Mantis working on IIS already after several trial and error!
Pls ignore the above Application Error (this is due to incorrect database being created!)

However, i got one problem here when using the Mantis Web APplication.
When i created a New user, and use the Lost Password features, the application will try to send the username with password to the email address. But now, the application has some error in sending email out from the server and give the following error msg :-
-----------------------------------------------------------------------------------
PROBLEMS SENDING MAIL TO:
Mailer Error: Could not instantiate mail function.

-----------------------------------------------------------------------------------



I made some modification to the SMTP (outgoing email) setting at the config_defaults_inc.php as follows
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
# This option allows you to use a remote SMTP host. Must use the phpMailer script
# Name of smtp host, needed for phpMailer, taken from php.ini

$g_smtp_host = '10.25.0.251';

# These options allow you to use SMTP Authentication when you use a remote
# SMTP host with phpMailer. If smtp_username is not '' then the username
# and password will be used when logging in to the SMTP server.

$g_smtp_username = 'peterlow';
$g_smtp_password = 'password';

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
The above smtp setting for $g_smtp_host, $g_smtp_username, and $g_smtp_password = 'password', are verified to be correct by our MIS for our office smtp email server.

However, the php application still return the same error msg whenever
the outgoing email features is required by the application




How to fix this error?? Help!!!
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

Hi,

Just another configuration setting: check out overriding $g_phpMailer_method and setting it to '2' for SMTP...
peterlow
Posts: 9
Joined: 11 Apr 2005, 07:45

Post by peterlow »

hi

Ok. I chg the line 273 in config_defaults_inc.php to :-
>>> $g_phpMailer_method= 2;



But now i got another new error. :-
---------------------------------------------------------------------------------
PROBLEMS SENDING MAIL TO:
Mailer Error: SMTP Error: The following recipients failed: admin

---------------------------------------------------------------------------------
However, the email is actually being sent out to the respectively destinated email address althrough the above error msg appear.


I tested on the Lost Password feature, it work perfectly fine without the above error msg appear.

help!
:<
hinke
Posts: 23
Joined: 15 Feb 2005, 08:35
Location: Lund, Sweden
Contact:

Hi

Post by hinke »

Does Admin have a correct email? Since it says "The following recipients failed: admin"

-Henrik
peterlow
Posts: 9
Joined: 11 Apr 2005, 07:45

Post by peterlow »

No we do not have any email account with the name admin (admin@mycompany.com).

How do we modify this to a valid email account that we have?
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

This is set through $g_administrator_email.
peterlow
Posts: 9
Joined: 11 Apr 2005, 07:45

Post by peterlow »

But the $g_administrator_email in config_defaults_inc.php and config_inc.php has already been modify to a valid email address.

Is there any other php need to be fix for this?
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

My mistake, I didn't read the problem carefully. If the error message comes from the creation of an account (or signup), all administrators are mailed a notification of the new account. The default admin account is set up with an email address of "admin". You could either change it, or, if you have created another administrator account, delete it.
peterlow
Posts: 9
Joined: 11 Apr 2005, 07:45

Post by peterlow »

hi ...
in the MySQL mantis database , i open up the mantis_user_table, and i modify the email field for username "adminstrator" to "peterlow@sato-int.com"

but now i got another new error msg
---------------------------------------------------------------------
PROBLEMS SENDING MAIL TO:
Mailer Error: SMTP Error: Could not authenticate.
----------------------------------------------------------------------

but the email was actually being sent out to the new account user.
Post Reply