I have a PHP file testphp.php with the following content:
<?php
echo system('mysql -u root -pMyPassword -e "SELECT VERSION();"');
?>
It outputs perfectly from the command line:
D:\>php testphp.php
VERSION()
5.5.24-log
5.5.24-log
D:\>
When I execute the same file via a web browser (http://localhost/testphp.php) , I see no output. Why?
file:///d:/testphp.phpit won't go through PHP - it needs to be through a web-server set up to run PHP.%PATH%enviroments, again apache runs on more restrictive account)