Wamp Apache Services in the XAMPP service problem in Apache?

Source: Internet
Author: User
Tags php error
The same project, placed in the Wamp Apache server, can be used normally, no error, but when placed in the XAMPP Apache server, will prompt the error, the error code is as follows:
notice:undefined Index:unc in D:\xampp\htdocs\cazlcompany0820\zhuce_jm.php on line 13
Also, the file code for zhuce_jm.php on line 13 is as follows:
Line 12 Line if ($_session["UNC"]== "") {
Line?>

It should be stated that the UNC variable is not defined in advance elsewhere.


Thank you, big guy!!!


Reply to discussion (solution)

PHP script plus: error_reporting (E_all & ~e_notice);

or change the error level in php.ini.

PHP script plus: error_reporting (E_all & ~e_notice);

or change the error level in php.ini.
Can you give an explanation of the meaning of this code?

Change the PHP error level
E_all Show all errors and warnings
~e_notice does not show NOTICE notifications

PHP script plus: error_reporting (E_all & ~e_notice);

or change the error level in php.ini.
Thank you very much, after the test found that really solve the problem, but can explain the reasons for it. Thank you!

Notice:undefined Index:unc ....
$_session["UNC"] not found

Your two environments are not configured the same
#1 is to get you to block out Notice level errors.
That's avoiding the problem.

But you should take a look at 13 lines before you see if the Session_Start function was executed.
and will
if ($_session["UNC"]== "") {
Switch
if (Isset ($_session["UNC") && $_session["UNC"]== "") {
is the robust code

if (Isset ($_session["UNC")) {
With Isset

Try it with Visual AMP, unzip to run,
Currently feel the best use of PHP integrated operating environment.

  • Related Article

    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.