473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

shell_exec() function

18 New Member
hi, i am having problem using shell_exec() function:
<code>
echo shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho | ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -w");
</code>
i am not getting the ouput file, though the command string passed in the function is working perfectly when used on the shell.

but when i am trying to execute it using this function in a php file, no ouput file is made.
so plz if anyone have an idea about this plz help me.

regards
Jul 30 '07 #1
2 1469
vituko
48 New Member
Does your hosting allow you to access the shell? Usually does not.
I see nothing strange in this statement...
Jul 30 '07 #2
Akkad
18 New Member
Actually i have full access to the shell but running this code in a php file on xampp server that i have on the linux, i am not getting the output even when i am trying to pipe the output to an html file .
<code>

shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho | ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html>akadi_icho.html");

</code>
but when i am running this code on the shell directly :
<code>
cat `find ./logs -name access.log*` | grep akadi_icho| ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -F html>akadi_icho.html
</code>
it is working perfectly.
so i have tried to run the code in parts :
<code>
shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho");
</code>
this part is working, but when i am running the whole part i am not getting any output.

so plz can u help me to figure out the problem.
Jul 31 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5946
by: Martin Hampl | last post by:
Hi, I couldn't compile php with java support on Mac OS X so I thought I'd call my java program with shell_exec(). It does work for simple programs ("hello world") but if the program gets more...
0
1556
by: Sandman | last post by:
In another post I told about PHP not being able to create dates earlier than 1970, so until I can get PHP to do so, I am using a small perlscript to do it. It looks like this: // $in is...
1
5917
by: Steve | last post by:
Hi, I'm trying to 'ssh' into another machine, run a small script and fetch it's output, using shell_exec(). The problem is, it takes AGES to run ssh and I don't know what's happening. If I try...
8
6256
by: Good Man | last post by:
Hi there If I enter the following at the command line, I successfully get an email sent to the correct name/email: php /var/www/html/admin/adminscripts/welcome-cli.php 'Me' 'me@me.net'
2
3144
by: bgeneto | last post by:
Can't get these commands to work! The following page simply doesn't finish loading ( Waiting... Opening... :-( ) <?php echo system("dir"); ?> The same for <?php echo exec("dir"); ?> or <?php...
6
5609
by: jonathan.beckett | last post by:
Hi all, We have PHP 4 installed on Windows 2003 with Apache 2, and the shell_exec has mysteriously stopped working - it hangs the page rather then returning anything. To check it out, I tried...
0
1328
by: Don | last post by:
Hi, I have a problem with the special characters on the function shell_exec (under Linux Debian with php 4.3.10-16): $msg = '"'."Léà t'es où?".'"'; $output = shell_exec('java myClass'.'...
3
3449
by: Paul F. Johnson | last post by:
Hi, I'm trying to create a zip file from some pdfs and have code similar to this $id=$_GET; $fn = array("a", "b", "c", "d"); chdir('../downloads'); // the php file is in /php $files =...
3
5307
by: pradeep | last post by:
Hello, I want to copy file from remote machine to local machine using PHP. On both machines Linux operating system present. The code is $result=shell_exec("scp...
0
1145
by: Akkad | last post by:
hi, i am having problem using shell_exec() function: <code> shell_exec("cat `find ./logs -name access.log*` | grep akadi_icho | ./calamaris/calamaris -a -P 60 -T 0 -r 400 -d 500 -u -O -w >...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.