# How to run ansible command in php code but it not working

**URL:** <https://forum.ansible.com/t/how-to-run-ansible-command-in-php-code-but-it-not-working/17771>\
**Category:** Ansible Project\
**Created:** [March 18, 2015, 10:38am UTC](https://forum.ansible.com/t/how-to-run-ansible-command-in-php-code-but-it-not-working/17771 "2015-03-18T10:38:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Be\_T\_p\_Code](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@Be\_T\_p\_Code](https://forum.ansible.com/u/Be_T_p_Code)\
**Post date:** [March 18, 2015, 10:38am UTC](https://forum.ansible.com/t/how-to-run-ansible-command-in-php-code-but-it-not-working/17771/1 "2015-03-18T10:38:12Z")

</div>

Hi All !  
I’m build web ui view and i want to running ansible command with php . for example:

\<?php $output = system("ansible host -m ping"); ?\>

But it not working, Please help me. Thanks !

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [March 20, 2015, 2:16pm UTC](https://forum.ansible.com/t/how-to-run-ansible-command-in-php-code-but-it-not-working/17771/2 "2015-03-20T14:16:39Z")

</div>

What’s happening when you do that? What happens if you use a different Shell command? This might end up being more of a php programming question than an ansible question.

-Toshio
