如何从保存PHP的其他网络访问文件?

I am currently working on a network called \\Luke\ which is where PHP is installed on. I need to be able to count the lines on a file located on a separate server called \\Leia\ . I have tried using CMD commands from my PHP file to perform this task, but I am not able to access files outside of \\Luke. From my research, this seems to be intended, PHP cant access files outside of the web directory where its saved. Due to constraints on a project, I cant install PHP onto \\Leia\ . If anyone has any suggestions on how I might be able to perform this task, it would be greatly appreciated!

$download_path = '\\\Leia\practice.txt';
exec('findstr "." '.$download_path.' | find /c /v "" 2>&1',$output,$status);
echo "Number of Lines: ".$output[0]."<br>";

PHP is a server based language that allows you to run code on the server so that the client (a remote browser) doesn't have direct access to your server content. Only information that your PHP program writes out is visible. However while your PHP code is running it has access within your server. If your server can mount a drive on another system, or has authority to do queries or other requests on the other system (Leia in your example), then you can do what you want.

PHP itself doesn't stop you from accessing other systems. For example, you might be doing database queries in your PHP program where the database is on a different machine than your web server. That's possible because your server has authority to access the database within the network.