I created a php project in WebMatrix on IIS. Within this project I accidently initialed same "session variable" two times.

     Example: File - a.php

     <?php
     $_Session['one'];
     include 'b.php';
     ...........
     ...........
     ...........
     ...........
     ?>

     Example: File - b.php

     <?php
     $_Session['one'];
     ...........
     ...........
     ...........
     ...........
     ?>

After I run this project from Webmatrix(IIS server) this error wasn't proven however when I went this project on Apache this error was displayed and that i remedied my defects.

   Warning on Apache:
   Notice: A session had already been started - ignoring session_start() in D:/path/.

My real question is that why this error wasn't proven earlier? Could it be something connected to IIS server or WebMatrix. I usually need to understand the errors or alerts within the code to ensure that I'm able to eliminate them and also the efficiency from the code is sustained, please suggest me some ideal php develeopment tools which could catch even minor errors during my code.

Ensure errors are now being displayed after which try turning error_confirming completely up at the outset of the applying.

ini_set('display_errors', 1);
error_reporting(E_ALL);


Also, remember that Home windows is not situation-sensitive. You can say include 'A.php' or include 'a.php' and it wouldn't care. However, when putting it on the Linux-based server, that is situation-sensitive, it might not have the ability to discover the file A.php if it is really a.php.

It is possible you have errors since the first server was running PHP 4 and the second reason is PHP 5. Double-together with a file that contains functions can get spun sentences in individuals versions. Begin to see the text right before example 6 within this link: http://php.net/manual/en/function.include.php

EDIT: In my opinion the mistake messages produced inside your edited publish indicate something of the different character.

For files that you would like to make certain they're only incorporated once, use include_once(). http://www.php.net/manual/en/function.include-once.php

You will find some situations in which you may legitimately wish to include() two times from the file. But because individuals the situation is rare, it is best to use include_once().

Warning on Apache:
   Notice: A session had already been started - ignoring session_start() in D:/path/.

You cannot start session again that is already began.

You'll need 1 session start in a.perl whenever you include b.php it may use began session.

Its an alert and warning means it is not good but php can deal with this error and continue working.

Its about error confirming level.

It's difficult to know if the mistake did not happened on IIS or otherwise. Only because it wasn't displayed or drenched, does not necessarily mean it did not occur. Please compare the error reporting php.ini configuration between both systems.

Another factor you need to compare in configuration is that if session auto-start have been enabled around the old or new system or otherwise. This can be triggering your error, but it is merely a guess. As written the mistake may have been already around the old system but simply was undetected.