<" />

<" />

<"/>

shell_exec gives wrong output from 'systemctl status php8.1-fpm'

95 Views Asked by At

On my Webpage i use the follow Codeblock:

<p>ufw:         <?=shell_exec("systemctl status ufw         | grep -w 'Active:' | awk '{\$1=\$1; print \$2, \$3}'");?></p>
<p>ssh:         <?=shell_exec("systemctl status ssh         | grep -w 'Active:' | awk '{\$1=\$1; print \$2, \$3}'");?></p>
<p>mysql:       <?=shell_exec("systemctl status mysql       | grep -w 'Active:' | awk '{\$1=\$1; print \$2, \$3}'");?></p>
<p>apache2:     <?=shell_exec("systemctl status apache2     | grep -w 'Active:' | awk '{\$1=\$1; print \$2, \$3}'");?></p>
<p>php8.1-fpm:  <?=shell_exec("systemctl status php8.1-fpm  | grep -w 'Active:' | awk '{\$1=\$1; print \$2, \$3}'");?></p>
<p>proftpd:     <?=shell_exec("systemctl status proftpd     | grep -w 'Active:' | awk '{\$1=\$1; print \$2, \$3}'");?></p>

The output shows:

ufw: active (exited)
ssh: active (running)
mysql: active (running)
apache2: active (running)
php8.1-fpm: active (running) sh -c grep -w
proftpd: active (running)

Why is the php line so different?

I was try different things for instance escape critical Signs but nothing was helpful.

0

There are 0 best solutions below