PHP/MYSQL on IIS 7.5

Hi,

I have an issue I went through the setup of PHP on IIS 7.5 and I am able to display the phpinfo.php sample file just fine.  I installed MySQL and set permissions to a user that the PHP site is using (Select, Delete, Insert, Update).

Every time I try to browse to this site I get website cannot be displayed.  I have not clue what I am doing wrong.  I added in the FastCGI ("Invoke handler only if request is mapped to: file)

There is nothing that I can see that is wrong and there is no troubleshooting messages.  I read the logs and all what it is logging is the different browsers that it supports and mine was listed

Thank you in advance
thomasm1948Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
becraigConnect With a Mentor Commented:
This seems like a variable being passed in, is a single value and not an array of values as it is expecting.

If it is pulling this info from a DB please check the values being populated from the DB to see if there is more than on (if any) being returned.
0
 
becraigCommented:
I am able to display the phpinfo.php sample file just fine.

You are able to do this using the servername / ip or domain name  ?



How are you attempting to browse to this site, and are any other sites configured on this server ?

I would ask you to ensure the site you are trying to access is configured to respond to the dns/ip you are calling.   Are you calling just the site or a specific page / resource ?
0
 
thomasm1948Author Commented:
I am using http://localhost/phpinfo.php and that works.  If I use http://localhost/index.php it is redirected to one folder down http://localhost/electrical/index.php fails
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
thomasm1948Author Commented:
I set everyone to have full control for testing
0
 
becraigCommented:
Can you click the arrow in IE when you get the site cannot be displayed message, so we can get the exact error .
0
 
thomasm1948Author Commented:
The following is the error message I am getting:

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

For more information about HTTP errors, see Help.

On IIS 7.5 Application pools and under the name it says that it is using .NET v2.0. .  I tried to set it no managed code as well and it does not work
0
 
becraigCommented:
Ok so a 500 indicates a problem with the actual app itself.

Can you change your index.php to a simple php page maybe echoing some php variables and see if it loads with no problem.

Backup a copy of your correct index.php first.
0
 
thomasm1948Author Commented:
OK, I finally got the PHP errors to work correctly.  The following is the error:

Fatal error: Call to undefined function mysql_connect() in C:\inetpub\wwwroot\three_rivers_dashboard\includes\Connections\link.php on line 14

The code that I am running is:

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_link = "localhost";
$database_link = "three_rivers";
$username_link = "meterdata_user";
$password_link = "PowerSaver";
#$link = mysql_pconnect($hostname_link, $username_link, $password_link) or trigger_error(mysql_error(),E_USER_ERROR);
?>


<?php
$con = mysql_connect('localhost', 'meterdata_user', 'PowerSaver');
if (!$con) {
    die('Could not connect: ' . mysql_error());
}
//echo 'Connected successfully';
mysql_select_db(three_rivers);
mysql_close($con);
?>


From what I see it should be working
0
 
thomasm1948Author Commented:
attached are the screen shots of the user's permissions.  I am new to MySQL believe these are correct
User.JPG
UserPermissions.JPG
0
 
thomasm1948Author Commented:
OK, I got past the above errors but now I get new errors:


Notice: Use of undefined constant three_rivers - assumed 'three_rivers' in C:\inetpub\wwwroot\three_rivers_dashboard\includes\Connections\link.php on line 19

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\inetpub\wwwroot\three_rivers_dashboard\includes\variables.php on line 60

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\inetpub\wwwroot\three_rivers_dashboard\includes\variables.php on line 60
 Query failed: Access denied for user 'ODBC'@'localhost' (using password: NO)
0
 
thomasm1948Author Commented:
OK, now I got passed those errors now I have the following:

Notice: Undefined variable: from in C:\inetpub\wwwroot\three_rivers_dashboard\electric\index.php on line 36

Notice: Undefined variable: from in C:\inetpub\wwwroot\three_rivers_dashboard\electric\index.php on line 38

Notice: Undefined variable: from in C:\inetpub\wwwroot\three_rivers_dashboard\electric\index.php on line 42

Notice: Undefined variable: from in C:\inetpub\wwwroot\three_rivers_dashboard\electric\index.php on line 49

Notice: Use of undefined constant Three_Rivers - assumed 'Three_Rivers' in C:\inetpub\wwwroot\three_rivers_dashboard\electric\includes\aggregations\aggregations.php on line 3

Notice: Use of undefined constant str_table_id - assumed 'str_table_id' in C:\inetpub\wwwroot\three_rivers_dashboard\electric\includes\get_required_meters_kwh_arrays.php on line 21

Notice: Use of undefined constant str_table - assumed 'str_table' in C:\inetpub\wwwroot\three_rivers_dashboard\electric\includes\get_required_meters_kwh_arrays.php on line 22

Notice: Use of undefined constant str_column - assumed 'str_column' in C:\inetpub\wwwroot\three_rivers_dashboard\electric\includes\get_required_meters_kwh_arrays.php on line 23

Notice: Use of undefined constant int_id_number - assumed 'int_id_number' in C:\inetpub\wwwroot\three_rivers_dashboard\electric\includes\get_required_meters_kwh_arrays.php on line 24

Notice: Undefined variable: from in C:\inetpub\wwwroot\three_rivers_dashboard\electric\includes\get_required_meters_kwh_arrays.php on line 41

Notice: Undefined variable: from in C:\inetpub\wwwroot\three_rivers_dashboard\electric\includes\get_required_meters_kwh_arrays.php on line 61
0
 
becraigCommented:
It would help to see the code here.

The errors are referencing aspects of your code I cannot see.
0
 
thomasm1948Author Commented:
I m getting closer here are my new errors

Warning: current() [function.current]: Passed variable is not an array or object in C:\inetpub\wwwroot\three_rivers\electric\includes\aggregations\Three_Rivers.php on line 77

Warning: array_pop() [function.array-pop]: The argument should be an array in C:\inetpub\wwwroot\three_rivers\electric\includes\aggregations\Three_Rivers.php on line 93

here is the code:

while ($interval = current($interval_time)) {
   //echo '<br />interval = '.$interval;
   
   $query = mysql_query("SELECT
   (`$meter1`) +
   (`$meter2`)  Total
                  FROM`tbl_temp`
                  WHERE`dtm_interval_time`='{$interval}'");
  if (!$query) {die("Database query failed: " . mysql_error());}
  while ($row = mysql_fetch_array($query)) {
       $arrayName[] = round($row["Total"],2);
}
next($interval_time);
}
0
 
thomasm1948Author Commented:
I added the following line at it seemed to clear the error:

if (is_array($interval)) {
while ($interval = current($interval_time)) {
   //echo '<br />interval = '.$interval;
   
   $query = mysql_query("SELECT
   (`$meter1`) +
   (`$meter2`)  Total
                  FROM`tbl_temp`
                  WHERE`dtm_interval_time`='{$interval}'");
  if (!$query) {die("Database query failed: " . mysql_error());}
  while ($row = mysql_fetch_array($query)) {
       $arrayName[] = round($row["Total"],2);
}
next($interval_time);
} }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.