In our company we have XAMPP running on our server. XAMPP however is running as a service on our server. Essentially if XAMPP shuts down it restarts automatically running as a service. Now because XAMPP is running as a service the standard php functions which allow you to check to see if a network drive is mapped won't work. The example shown below won't work. In my php scripts I access directories and files via UNC. If XAMPP is not running as a service the example given below will work. It's preferred however to run XAMPP as a service within our company. My question is, is there any way of checking if a network drive is mapped even though XAMPP is running as a service?
Any help much appreciated.
<?php
$mydir = "G:\ ";
echo file_exists($mydir) ? "G is mounted":"G is not mounted";
?>