Page 1 of 1
Calling XP control panel applets from php
Posted: Fri Aug 11, 2006 1:12 pm
by Brent
I am able to directly call control panel applets using the command prompt i.e. "control desk.cpl". The problem is that when using php or even javascript to run the command the applet never appears. I have tried running a batch file to execute the command. I have tried using CALL. It works properly when I use the PHP CLI to run it but when I run the PHP CLI from a PHP page I still have the same problem. I have tried exec(), system(), passthru(), shell_exec(), all with the same result. I would greatly appreciate any help or if anyone knows of another way to open control panel applets from a browser.
exec('control desk.cpl');
Thanks
Note: This will be hosted and accessed on the local machine.
Posted: Fri Aug 11, 2006 1:18 pm
by s.dot
Seems your PHP script would need an absolute path to the program (not sure what that would be).
Posted: Fri Aug 11, 2006 1:27 pm
by Brent
scottayy wrote:Seems your PHP script would need an absolute path to the program (not sure what that would be).
The php-cgi.exe and obviously control.exe are in the PATH. The bat file resides in the same directory as the php page it is being run from, although I have tried specifying the complete path with no results.
Posted: Fri Aug 11, 2006 2:12 pm
by volka
Brent wrote:works properly when I use the PHP CLI to run it
understood, but
Brent wrote:but when I run the PHP CLI from a PHP page I still have the same problem.
what does "php cli from a php page" mean?
Posted: Fri Aug 11, 2006 2:37 pm
by feyd
When php is run from the command prompt it has all the rights of your logged in user. When run from the web server it takes on the rights of the web server's user, which is rarely the same as who you are logged in as.
...That's a hint as to a possible solution.
Posted: Fri Aug 11, 2006 2:50 pm
by Weirdan
services are usually not allowed to interact with desktop, there's specific setting under My Computer/Manage/Services/Apache that has to be turned on