title: Checking service status with php on linux?
body: <p>I'm trying to read status of a service using php7 on Debian 9.
  The command is simple: </p>
  
  <pre><code>sudo -u root -S service openvpn@debideb status &lt; /var/www/html/.htpass
  </code></pre>
  
  <p>I do get desired result when I test it in terminal:</p>
  
  <pre><code>openvpn@debideb.service - OpenVPN connection to debideb
     Loaded: loaded (/lib/systemd/system/openvpn@.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2018-06-25 06:17:15 PDT; 1h 2min ago
       Docs: man:openvpn(8)
             https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
             https://community.openvpn.net/openvpn/wiki/HOWTO
    Process: 5049 ExecStart=/usr/sbin/openvpn --daemon ovpn-debideb --status /run/openvpn/debideb.status 10 --cd /etc/openvpn -
   Main PID: 5051 (openvpn)
      Tasks: 1 (limit: 4915)
     CGroup: /system.slice/system-openvpn.slice/openvpn@debideb.service
             └─5051 /usr/sbin/openvpn --daemon ovpn-debideb --status /run/openvpn/debideb.status 10 --cd /etc/openvpn --config 
  </code></pre>
  
  <p>however,when I do it through www-data I get following results:
  <code>passthru()</code> returns <code>int(1)</code>;
  <code>shell_exec()</code> returns <code>NULL</code>;
  <code>exec()</code> and <code>system()</code> return <code>string("")</code>;</p>
  
  <p>Where did I screw up?</p>