[SOLVED] running an exe program

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

[SOLVED] running an exe program

Post by pelegk2 »

i run this line :

Code: Select all

<?php
exec ("doc2rtf ".$file[0]." ".$file[1]);
?>
the strane thing is that when i run the same from command line it takes no more then a second
but when i run this line from php script it can take a minute and even ,ore
why is that>
tnaks in advance
peleg
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Different file sizes? Plus your making apache load php, which is then running a system command, which is then running the requested program. Its bound to take a bit longer. Why not see if there is a php class that does the same things, or write one.
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

but i dont see where is the problem?
it should take less then a second?
what to look for?
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

i would try simplifying things extremely.


maybe write a simple "hello world" program and execute that from php. see if that still takes forever to run.

if so, well at least you narrowed it down some

i havent used exec before, but doesnt it return some info from the system? maybe php is stuck waiting for this info....

what does the program do? that may help find the problem...
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

ok the prblem is solved!!!!
i went to the apache service and told it to interact with the desktop as some 1 told me and know it works fine:)
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Yep. ;)

Glad you got that workin'.
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

Post by pelegk2 »

yes it was u samy:):):):):
Post Reply