I am developing a web application, and one of its features includes launching a VNC client with a particular IP. I know this can be dangerous, but it's an internal system that will be locked down. I can do this from Terminal like this:
Which I can easily wrap into, say, a PHP script:
And if I save this as a file, say openvnc.php and run it from the Terminal:
It launches the appropriate VNC client with that IP address (Chicken of the VNC in my case).
The odd thing though, is that if I put the PHP file in my /Library/WebServer/Documents/ folder and then run it from Safari:
It doesn't execute the command. Other, simpler commands will run from PHP, like "ls" or "pwd" however. I'm assuming this is a security precaution, but I know that it's definitely possible (for instance, the iCapture website, which lets you see what your website looks like in Safari, I'm assuming it's launching an AppleScript from the web script). Trying to run "osascript" also doesn't work, for that matter.
I am open to using other solutions than PHP. Does anyone know how I can get this working? Thanks!
P.S. This is probably clear from my post, but the website and the VNC viewer will be running on the same box, a Mac.