# Help to integrate Shell script with PHP

**URL:** <https://community.unix.com/t/help-to-integrate-shell-script-with-php/368165>\
**Category:** Web Development\
**Created:** [September 4, 2017, 6:25am UTC](https://community.unix.com/t/help-to-integrate-shell-script-with-php/368165 "2017-09-04T06:25:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhuwan\_Nazkani](https://community.unix.com/letter_avatar/bhuwan_nazkani/32/5_5575768a8748004e209b776fc1b2916d.png) [@Bhuwan\_Nazkani](https://community.unix.com/u/Bhuwan_Nazkani)\
**Post date:** [September 4, 2017, 6:25am UTC](https://community.unix.com/t/help-to-integrate-shell-script-with-php/368165/1 "2017-09-04T06:25:09Z")

</div>

I have a shell script which takes user name and server name from the user and check the authentication type on that server like LDAP or VAS or local. It also provides various other info also such as owner of the ID and etc.  
I need this script to work on the browser where user can directly input the values and get the output. For this I need to integrate my shell script with php or cgi.  
Please help me in integrating it as I have not much idea in php.

---

<div class="post-metadata">

**Author:** ![seco](https://community.unix.com/letter_avatar/seco/32/5_5575768a8748004e209b776fc1b2916d.png) [@seco](https://community.unix.com/u/seco)\
**Post date:** [February 25, 2018, 3:51am UTC](https://community.unix.com/t/help-to-integrate-shell-script-with-php/368165/2 "2018-02-25T03:51:16Z")

</div>

I think you can use exec PHP function to run your script.  
Don't forget to make it executable using chmod +x ./script.sh

---

<div class="post-metadata">

**Author:** ![jgt](https://community.unix.com/user_avatar/community.unix.com/jgt/32/10703_2.png) [@jgt](https://community.unix.com/u/jgt)\
**Post date:** [February 25, 2018, 9:26am UTC](https://community.unix.com/t/help-to-integrate-shell-script-with-php/368165/3 "2018-02-25T09:26:58Z")

</div>

```nohighlight
<?php
$ouptut=`pwd`;
echo $ouptut;
?>

```
