LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   PHP pass argument to shell script (http://www.linuxquestions.org/questions/programming-9/php-pass-argument-to-shell-script-217253/)

monzter 08-13-2004 02:55 PM

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 :)

masand 08-13-2004 04:10 PM

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

david_ross 08-14-2004 06:16 AM

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


All times are GMT -5. The time now is 08:48 PM.