BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 01-06-2009, 05:43 PM   #101
clicker666
Knows Where the Search Button Is
 
Join Date: Jul 2007
Location: Nova Scotia, Canada
Model: None
PIN: N/A
Carrier: Telus
Posts: 22
Default

Please Login to Remove!

Quote:
Originally Posted by blubyu View Post
clicker666 and spy1309, do a favor for me. Go into your php folder and open up your php.ini file. Find the following line:

Code:
error_reporting = E_All
comment out that line by puting a ';' in front of it (without the quotes).

A few lines above it find this line and uncomment it:

Code:
error_reporting = E_All & ~E_NOTICE | E_STRICT
Save the file and restart your IIS. Then open up the phpberrystats index page. This should give an additional line or two of errors along with the Unable to Connect to Database line. From the additional information we should be able to tell what is wrong. I hope
Here's the results:

Code:
PHP Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Halifax' for '-4.0/no DST' instead in C:\Inetpub\wwwroot\phpberrystats\includes\html_header.php on line 21 

PHP Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 10.0.0.2 in C:\Inetpub\wwwroot\phpberrystats\includes\common_funcs.php on line 27 

PHP Warning: mssql_select_db() [function.mssql-select-db]: Unable to connect to server: (null) in C:\Inetpub\wwwroot\phpberrystats\includes\common_funcs.php on line 28 

PHP Warning: mssql_select_db() [function.mssql-select-db]: A link to the server could not be established in C:\Inetpub\wwwroot\phpberrystats\includes\common_funcs.php on line 28
Offline  
Old 01-06-2009, 05:48 PM   #102
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Default

Ok. This is telling us that you can't connect to the server. Which means it doesn't have anything to do with the username, password or database name. Now we need to find out why you can't connect to the server.

I can't remember if you have tried, but can you change your ip number in your config.php file to 127.0.0.1 and see if that makes a difference? If I remember right you are running both php and the bes software on the same server.
Offline  
Old 01-06-2009, 05:50 PM   #103
clicker666
Knows Where the Search Button Is
 
Join Date: Jul 2007
Location: Nova Scotia, Canada
Model: None
PIN: N/A
Carrier: Telus
Posts: 22
Default

Same error with 127.0.0.1.
Offline  
Old 01-06-2009, 06:11 PM   #104
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Default

Is there any kind of software firewall installed on that server? Something is not letting the php software talk to the SQL software.

One more thing. Is your SQL database listening on the default port of 1433 or has it been changed? I just discovered that my code just assumes that the database is running on the default port

I just did some more reading on SQL express. This is how you find out what port it is using (I guess it doesn't always use the default port):

Don´t use the standard MS-SQL port (1433), use the MS-SQL dinamic port under SQL Server Configuration Manager -> SQL Express Protocols -> TCP/IP properties -> IP Adresses -> IPAll

If the port it is using is not 1433, then that is the problem and I know how to fix it.

Last edited by blubyu; 01-06-2009 at 06:23 PM.. Reason: added more info
Offline  
Old 01-06-2009, 07:56 PM   #105
clicker666
Knows Where the Search Button Is
 
Join Date: Jul 2007
Location: Nova Scotia, Canada
Model: None
PIN: N/A
Carrier: Telus
Posts: 22
Default

Quote:
Originally Posted by blubyu View Post
Is there any kind of software firewall installed on that server? Something is not letting the php software talk to the SQL software.

One more thing. Is your SQL database listening on the default port of 1433 or has it been changed? I just discovered that my code just assumes that the database is running on the default port

I just did some more reading on SQL express. This is how you find out what port it is using (I guess it doesn't always use the default port):

Don´t use the standard MS-SQL port (1433), use the MS-SQL dinamic port under SQL Server Configuration Manager -> SQL Express Protocols -> TCP/IP properties -> IP Adresses -> IPAll

If the port it is using is not 1433, then that is the problem and I know how to fix it.
Bingo - port is 1278.
Offline  
Old 01-06-2009, 07:57 PM   #106
clicker666
Knows Where the Search Button Is
 
Join Date: Jul 2007
Location: Nova Scotia, Canada
Model: None
PIN: N/A
Carrier: Telus
Posts: 22
Default

Quote:
Originally Posted by clicker666 View Post
Bingo - port is 1278.
I wonder if that is because I have three instances (or whatever they are called now a days) running. (Backup Exec, Bid2Win, and SQLExpress (BESMgmt lives here).))
Offline  
Old 01-07-2009, 10:53 AM   #107
blubyu
Thumbs Must Hurt
 
blubyu's Avatar
 
Join Date: Jun 2005
Model: 7520
Carrier: nextel
Posts: 116
Default

From what little I read it sounded like SQLExpress doesn't use the default SQL port. I don't know didly about SQL so I don't know if this is true or not. But..........I think we can fix it.

Go into the includes directory in the phpberrystats folder and open up the common_funcs.php file. Look for this line:

Code:
$connect=mssql_connect(DBHOST,DBUSER,DBUSERPW);
And change it to this:

Code:
$connect=mssql_connect('yourserverip:1278',DBUSER,DBUSERPW);
By default, when a port isn't specifed it uses the default port (in this case 1433). In the config.php file I ask for the default DB port but I have now discoved that I don't use it anywhere

The above line should try and connect to your server ip at port 1278. Once I know it works for you I will spend some time and make use of the DBPORT variable in the config.php.
Offline  
Old 01-07-2009, 11:27 AM   #108
clicker666
Knows Where the Search Button Is
 
Join Date: Jul 2007
Location: Nova Scotia, Canada
Model: None
PIN: N/A
Carrier: Telus
Posts: 22
Default

No love, sorry. Exactly same error. I've tried 127.0.0.1, localhost, and 10.0.0.2.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog picture

Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog

$650.00



HealthKit 4802 Computer Oscilloscope Heath Computer Systems picture

HealthKit 4802 Computer Oscilloscope Heath Computer Systems

$120.00



New PCI-MIO-16E-4 Data Acquisition Card With 16 Analog Input Channels for NI picture

New PCI-MIO-16E-4 Data Acquisition Card With 16 Analog Input Channels for NI

$311.00



HealthKit 4802 Computer Oscilloscope Heath Computer Systems picture

HealthKit 4802 Computer Oscilloscope Heath Computer Systems

$149.99



NEW NO BOX- Analog Devices AIM03 Computer Module || Fast Shipped🇺🇸Warranty picture

NEW NO BOX- Analog Devices AIM03 Computer Module || Fast Shipped🇺🇸Warranty

$150.00



1PC × PR ELECTRONIC 2211 ANALOG CALCULATOR PR2211EC2A2 Ser.No. 885175 picture

1PC × PR ELECTRONIC 2211 ANALOG CALCULATOR PR2211EC2A2 Ser.No. 885175

$85.00







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.