Apache is running normally and iis prompts error 500. what is the problem?

Source: Internet
Author: User
Apache is running normally and iis prompts error 500. what is the problem? 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 "script" alert ('logon failed'); window. location. href = 'login. php'; script ";
} Else {
Session_start ();
$ _ SESSION ['username'] = $ username;
$ _ SESSION ['zhibu'] = $ var_zhibu;
}

$ Mysqli-> close ();
?>

This section is okay on Apache. I use wampserver2.5 (Apache 2.4.9) and the error 500 is prompted on iis7. what is the possible cause?
In conn. php, there is one sentence: $ mysqli = new mysqli ('localhost: 100', 'username', 'password', 'DB _ name ');


Reply to discussion (solution)

Is the port occupied by apache?
Or the rewrite method is incorrect. iis is not supported.

Enable the error display function of php to know where the problem is located.

Is the port occupied by apache?
Or the rewrite method is incorrect. iis is not supported.



It's not a port issue. I only open Apache or iis at a time.

$ Stmt = $ mysqli-> prepare ($ SQL );
It seems to be a problem. when IIS is used, var_dump ($ stmt) returns null.

Mysqli is not properly installed.
In iis, check whether phpinfo (); has the mysqli extension.

Enable the error display function of php to know where the problem is located.



[04-Sep-2015 03:58:58 Europe/Paris] PHP Warning: mysqli (): in E: \ wamp \ www \ phpsite \ 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. php: 2
[04-Sep-2015 03:58:58 Europe/Paris] PHP Warning: mysqli: prepare (): 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 is not properly installed.
In iis, check whether phpinfo (); has the mysqli extension.



I have installed wampserver and mysqli. I have installed PHPmanager in iis and it shows that mysqli has been enabled.

Enable the error display function of php to know where the problem is located.



Do not know how to solve the problem ..

Is it so difficult to enable the php error display function?

The log provides too little information, which is too brief
[04-Sep-2015 03:58:58 Europe/Paris] PHP Warning: mysqli: prepare (): Couldn't fetch mysqli in E: \ wamp \ www \ phpsite \ welcome. php on line 13
Unable to read mysqli

Use exampleon http://php.net/manual/en/mysqli.construct.php to final the result:

Connect Error (2002) unable to Connect because the target computer is actively rejected.

Is it so difficult to enable the php error display function?

The log provides too little information, which is too brief
[04-Sep-2015 03:58:58 Europe/Paris] PHP Warning: mysqli: prepare (): Couldn't fetch mysqli in E: \ wamp \ www \ phpsite \ welcome. php on line 13
Unable to read mysqli



I opened display error = on, but only error 500 is displayed on the webpage. I don't know why

Mysqli is not properly installed.
In iis, check whether phpinfo (); has the mysqli extension.



Yes

The error is found. Because IIS and wampserver cannot be enabled at the same time, when I enable iis, wampserver is disabled, so wampserver's wampmysqld64 service is not enabled (I set it to manual earlier, so it is not started randomly ), the role of wampmysqld64 should be understood from the name, so mysql in wamp cannot be connected without it. Thank you 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.