LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Can I execute a shell script from inside a php one. (https://www.linuxquestions.org/questions/linux-software-2/can-i-execute-a-shell-script-from-inside-a-php-one-447995/)

prabhatsoni 05-24-2006 04:05 AM

Can I execute a shell script from inside a php one.
 
Hi friends,
I was wondering whether it is possible to somehow execute some shell script from inside a php script ?
Ok, the scenerio is like this.

I have portal for my organisation, and the same is available from the intranet. The authentication is done by a user table that I have created and that stores the passwords in a sha1 hash.
Now, there are some services that I am makeing available to my users and these utilise the system account for the users.

Now when my user changes his password through the portal, I want to change the password in the user table as well as the system account. The first part is not a problem and is working as of now. I want a shell script to change the system password at the same time.

Can it be done ?

Thanks a lot.


Prabhat Soni

debulu 05-24-2006 04:13 AM

You can use system("/bin/bash your_script.sh")
hope helps

KarlosDaJackel 05-24-2006 05:40 AM

You can also just type the command in backticks (not single quotes) like so

$mystring = `uname -a`
echo $mystring


All times are GMT -5. The time now is 04:35 AM.