linux Scripts and php

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
tafil
Forum Newbie
Posts: 2
Joined: Sat Nov 01, 2008 3:58 pm

linux Scripts and php

Post by tafil »

Hi,

I am new at PHP programing and i have not so much experience with PHP, my problem is like that i wrote few Shell Script that have to work on CentOS,i already configured the Apache Server but is it any possibility to make a simple PHP script or page that can execute the scripts and show me the output of the scripts on the PHP page.
I thought it like this to have a button and a text filed if i press the button it should execute the script and show the output of the script on the text filed.
The second thing is it possible to enter something on the text filed and if i press the button to add the text after the script (for example ./script.sh field text) and execute the script.

As i said i have no experience on php, I hope that someone can help me with a short example code.

Thanks in advance.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: linux Scripts and php

Post by VladSun »

Take a look at:
system()
passthru()
escapeshellcmd()
backtick operator
exec()
shell_exec ()
There are 10 types of people in this world, those who understand binary and those who don't
tafil
Forum Newbie
Posts: 2
Joined: Sat Nov 01, 2008 3:58 pm

Re: linux Scripts and php

Post by tafil »

thanks for you help but i really don't understand that. Maybe someone has a sample code?
tahnks
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: linux Scripts and php

Post by VladSun »

There are a *lot* of sample code snippets in the manuals of the functions I've pointed to in my previous post.
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply