PHP
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists PHP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 6th, 2008, 07:21 AM
Waynn Lue
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Asynchronous PHP Execution

>
and exec/shell (but that
>
>doesn't seem to be asynchronous), but neither seems optimal.
>>

>

It can be if you redirect the output streams and put an ampersand after it:
>

<?php
exec('sleep 5 /dev/null 2>/dev/null &');
echo 'Script ended';
?>
>

This tiny sample should end immediately, and the sleep command should run
on regardless.
>

Thanks so much for the suggestion, that's what I ended up doing and it
worked, after some fiddling. Just as a side note, does it execute from the
current directory of the file? Previously, I tried calling exec('php
scripts/foo.php'), but it seemed like there was some weird interaction
between different required files. E.g., this was the layout:

orig.php
scripts/foo.php
incl.php


orig.php had the exec line, and foo.php had require_once(/incl.php). But
it seemed like the exec call caused foo.php to execute from the scripts
directory while the require_once caused incl.php to also execute from the
scripts directory.

How does php determine what the working directory is?

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists PHP > Asynchronous PHP Execution


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT