LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 08-13-2004, 03:55 PM   #1
monzter
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("mk_dir.sh /home/test");
?>

on PHP

and

#!/bin/sh
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
masand
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
regards
 
Old 08-14-2004, 07:16 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

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


Reply


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


All times are GMT -5. The time now is 07:24 AM.

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