Arguments lenght while execution shell commands problem
Posted: Sun Sep 12, 2010 8:54 am
Hello,
I'm stack with one problem and can not find aby solution in net or php.net documentation. So I decided to post here my problem hope someone will point me to some clue.
I'm tring to fire command line program using one of PHP functions: exec, system, etc... (no matter witch one I use). In my application I need to pass one parameter to it eg:
<?php
$param = 'foobar';
$output = exec("./some_script.o -e $param");
?>
Problem occures when the $param is longer then 229 signs. If so exec command returns empty $output. Very important clue is that it is not the problem of 'some_script.o' because when I fire it in debian shell it takes longer parametes. I feel in my neck that it is some kind of problem with configuration of PHP (some php.ini buffer size or something similar).
Any one of You face with sililar problem. I would appriciate any help.
Greetings
Pawel
I'm stack with one problem and can not find aby solution in net or php.net documentation. So I decided to post here my problem hope someone will point me to some clue.
I'm tring to fire command line program using one of PHP functions: exec, system, etc... (no matter witch one I use). In my application I need to pass one parameter to it eg:
<?php
$param = 'foobar';
$output = exec("./some_script.o -e $param");
?>
Problem occures when the $param is longer then 229 signs. If so exec command returns empty $output. Very important clue is that it is not the problem of 'some_script.o' because when I fire it in debian shell it takes longer parametes. I feel in my neck that it is some kind of problem with configuration of PHP (some php.ini buffer size or something similar).
Any one of You face with sililar problem. I would appriciate any help.
Greetings
Pawel