Apache is functioning correctly and IIS prompts error 500 what might be the problem

Source: Internet
Author: User
Tags phpinfo stack trace
Include (' conn/conn.php ');
Var_dump ($MYSQLI);
$sql = "SELECT * from user where username=? and password=? and var_zhibu=? ";
$stmt = $mysqli->prepare ($sql);
$stmt->bind_param ("SSS", $username, $password, $var _zhibu);
Var_dump ($stmt);
$username =@$_post[' username '];
$password =md5 (@$_post[' password ');
$var _zhibu=@$_post[' Zhibu '];

$stmt->execute ();

if (! $stmt->fetch ()) {
echo "";
}else{
Session_Start ();
$_session[' username ']= $username;
$_session[' Zhibu ']= $var _zhibu;
}

$mysqli->close ();
?>

This paragraph in Apache no problem, I use wampserver2.5 (Apache 2.4.9), on the IIS7 error 500, ask what may be the reason
Conn.php in a word: $mysqli =new mysqli (' localhost:3306 ', ' username ', ' password ', ' db_name ');


Reply to discussion (solution)

is the port being occupied by Apache?
Or rewrite is wrong, does not support the syntax of IIS.

Open the error display function of PHP, you can know the problem

is the port being occupied by Apache?
Or rewrite is wrong, does not support the syntax of IIS.



Not a port issue, I only open Apache or IIS at a time

$stmt = $mysqli->prepare ($sql);
Seems to be the problem with IIS when Var_dump ($stmt) result is null

Mysqli's not loaded.
Under IIS, look at Phpinfo (); There are no mysqli extensions.

Open the error display function of PHP, you can know the problem



[04-sep-2015 03:58:58 Europe/paris] PHP warning:mysqli::mysqli (): In E:\wamp\www\phpsite\conn\conn.php on line 2
[04-sep-2015 03:58:58 Europe/paris] PHP Stack Trace:
[04-sep-2015 03:58:58 Europe/paris] PHP 1. {main} () e:\wamp\www\phpsite\welcome.php:0
[04-sep-2015 03:58:58 Europe/paris] PHP 2. Include () e:\wamp\www\phpsite\welcome.php:10
[04-sep-2015 03:58:58 Europe/paris] PHP 3. Mysqli->mysqli () E:\wamp\www\phpsite\conn\conn.php:2
[04-sep-2015 03:58:58 Europe/paris] PHP warning:mysqli::p repare (): couldn ' t fetch mysqli in E:\wamp\www\phpsite\welcome.php on line 13
[04-sep-2015 03:58:58 Europe/paris] PHP Stack Trace:
[04-sep-2015 03:58:58 Europe/paris] PHP 1. {main} () e:\wamp\www\phpsite\welcome.php:0
[04-sep-2015 03:58:58 Europe/paris] PHP 2. Mysqli->prepare () e:\wamp\www\phpsite\welcome.php:13
[04-sep-2015 03:58:58 Europe/paris] PHP Fatal Error:call to a member function Bind_param () on a non-object in E:\wamp\www\phpsite\welcome.php on line 15
[04-sep-2015 03:58:58 Europe/paris] PHP Stack Trace:
[04-sep-2015 03:58:58 Europe/paris] PHP 1. {main} () e:\wamp\www\phpsite\welcome.php:0

Mysqli's not loaded.
Under IIS, look at Phpinfo (); There are no mysqli extensions.



I finished wampserver,mysqli with the good, in IIS installed Phpmanager, display mysqli already enabled AH

Open the error display function of PHP, you can know the problem



Know the problem is not know how to solve.

Is it so hard to open the error display of PHP?

The log provides too little information, too brief
[04-sep-2015 03:58:58 Europe/paris] PHP warning:mysqli::p repare (): couldn ' t fetch mysqli in E:\wamp\www\phpsite\welcome.php on line 13
Unable to read mysqli

With the example on the http://php.net/manual/en/mysqli.construct.php, the result:

Connect Error (2002) cannot connect because the target computer is actively rejecting.

Is it so hard to open the error display of PHP?

The log provides too little information, too brief
[04-sep-2015 03:58:58 Europe/paris] PHP warning:mysqli::p repare (): couldn ' t fetch mysqli in E:\wamp\www\phpsite\welcome.php on line 13
Unable to read mysqli



I turned on the display error = on but the page still only shows errors 500, I do not know why

Mysqli's not loaded.
Under IIS, look at Phpinfo (); There are no mysqli extensions.



Some

The error was found. Because IIS and Wampserver cannot open at the same time, when I open IIS Wampserver, so wampserver wampmysqld64 service also did not open (earlier I was set to Manual, so also did not randomly start), WAMPMYSQLD64 's role should be understood from the name, without which it is not even wamp MySQL. Thank you so much for your enthusiastic participation.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.