thomasm1948
asked on
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
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
ASKER
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
ASKER
I set everyone to have full control for testing
Can you click the arrow in IE when you get the site cannot be displayed message, so we can get the exact error .
ASKER
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
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
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.
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.
ASKER
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_r ivers_dash board\incl udes\Conne ctions\lin k.php on line 14
The code that I am running is:
<?php
# FileName="Connection_php_m ysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_link = "localhost";
$database_link = "three_rivers";
$username_link = "meterdata_user";
$password_link = "PowerSaver";
#$link = mysql_pconnect($hostname_l ink, $username_link, $password_link) or trigger_error(mysql_error( ),E_USER_E RROR);
?>
<?php
$con = mysql_connect('localhost', 'meterdata_user', 'PowerSaver');
if (!$con) {
die('Could not connect: ' . mysql_error());
}
//echo 'Connected successfully';
mysql_select_db(three_rive rs);
mysql_close($con);
?>
From what I see it should be working
Fatal error: Call to undefined function mysql_connect() in C:\inetpub\wwwroot\three_r
The code that I am running is:
<?php
# FileName="Connection_php_m
# Type="MYSQL"
# HTTP="true"
$hostname_link = "localhost";
$database_link = "three_rivers";
$username_link = "meterdata_user";
$password_link = "PowerSaver";
#$link = mysql_pconnect($hostname_l
?>
<?php
$con = mysql_connect('localhost',
if (!$con) {
die('Could not connect: ' . mysql_error());
}
//echo 'Connected successfully';
mysql_select_db(three_rive
mysql_close($con);
?>
From what I see it should be working
ASKER
attached are the screen shots of the user's permissions. I am new to MySQL believe these are correct
User.JPG
UserPermissions.JPG
User.JPG
UserPermissions.JPG
ASKER
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_r ivers_dash board\incl udes\Conne ctions\lin k.php on line 19
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\inetpub\wwwroot\three_r ivers_dash board\incl udes\varia bles.php on line 60
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\inetpub\wwwroot\three_r ivers_dash board\incl udes\varia bles.php on line 60
Query failed: Access denied for user 'ODBC'@'localhost' (using password: NO)
Notice: Use of undefined constant three_rivers - assumed 'three_rivers' in C:\inetpub\wwwroot\three_r
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\inetpub\wwwroot\three_r
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\inetpub\wwwroot\three_r
Query failed: Access denied for user 'ODBC'@'localhost' (using password: NO)
ASKER
OK, now I got passed those errors now I have the following:
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\index .php on line 36
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\index .php on line 38
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\index .php on line 42
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\index .php on line 49
Notice: Use of undefined constant Three_Rivers - assumed 'Three_Rivers' in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\inclu des\aggreg ations\agg regations. php on line 3
Notice: Use of undefined constant str_table_id - assumed 'str_table_id' in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\inclu des\get_re quired_met ers_kwh_ar rays.php on line 21
Notice: Use of undefined constant str_table - assumed 'str_table' in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\inclu des\get_re quired_met ers_kwh_ar rays.php on line 22
Notice: Use of undefined constant str_column - assumed 'str_column' in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\inclu des\get_re quired_met ers_kwh_ar rays.php on line 23
Notice: Use of undefined constant int_id_number - assumed 'int_id_number' in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\inclu des\get_re quired_met ers_kwh_ar rays.php on line 24
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\inclu des\get_re quired_met ers_kwh_ar rays.php on line 41
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r ivers_dash board\elec tric\inclu des\get_re quired_met ers_kwh_ar rays.php on line 61
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r
Notice: Use of undefined constant Three_Rivers - assumed 'Three_Rivers' in C:\inetpub\wwwroot\three_r
Notice: Use of undefined constant str_table_id - assumed 'str_table_id' in C:\inetpub\wwwroot\three_r
Notice: Use of undefined constant str_table - assumed 'str_table' in C:\inetpub\wwwroot\three_r
Notice: Use of undefined constant str_column - assumed 'str_column' in C:\inetpub\wwwroot\three_r
Notice: Use of undefined constant int_id_number - assumed 'int_id_number' in C:\inetpub\wwwroot\three_r
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r
Notice: Undefined variable: from in C:\inetpub\wwwroot\three_r
It would help to see the code here.
The errors are referencing aspects of your code I cannot see.
The errors are referencing aspects of your code I cannot see.
ASKER
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_r ivers\elec tric\inclu des\aggreg ations\Thr ee_Rivers. php on line 77
Warning: array_pop() [function.array-pop]: The argument should be an array in C:\inetpub\wwwroot\three_r ivers\elec tric\inclu des\aggreg ations\Thr ee_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);
}
Warning: current() [function.current]: Passed variable is not an array or object in C:\inetpub\wwwroot\three_r
Warning: array_pop() [function.array-pop]: The argument should be an array in C:\inetpub\wwwroot\three_r
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`='
if (!$query) {die("Database query failed: " . mysql_error());}
while ($row = mysql_fetch_array($query))
$arrayName[] = round($row["Total"],2);
}
next($interval_time);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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);
} }
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`='
if (!$query) {die("Database query failed: " . mysql_error());}
while ($row = mysql_fetch_array($query))
$arrayName[] = round($row["Total"],2);
}
next($interval_time);
} }
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 ?