Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-13-2004, 03:55 PM   #1
LQ Newbie
Registered: Aug 2004
Posts: 4

Rep: Reputation: 0
PHP pass argument to shell script

I try to pass argument to shell script with PHP
It not work!

I try

shell_exec(" /home/test");

on PHP


mkdir $1

on shell script

Shell can work console but not work when I run with PHP

What wrong with me?
and what should I do?
or I need to setup something on my RH9 server ?

pls tell me thank
Old 08-13-2004, 05:10 PM   #2
LQ Guru
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
lookout for help in
'escapeshellargs' function
in PHP and try using 'passthru' functions in PHP

then u can execute ur commads with arguments in them
Old 08-14-2004, 07:16 AM   #3
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Also make sure that the script you are trying to run is in the PATH for php. Try using the full path.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass a row to another PHP script bahadur Programming 5 12-24-2011 02:07 AM
how to pass command-line parameter to shell script? Kropotkin Linux - Newbie 12 07-25-2011 10:24 AM
Procmail: match pattern then pass to shell script essdeeay Linux - Software 1 11-08-2004 03:19 PM
How to pass arguments from $prompt for php script ukjairaj Linux - Software 4 06-25-2004 12:14 PM
PHP Script argument passing error... lokee Linux - Software 5 04-24-2003 10:42 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration