Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-17-2009, 02:09 PM   PM User | #1
cesarcesar
Regular Coder

 
Join Date: Apr 2007
Posts: 144
Thanks: 5
Thanked 0 Times in 0 Posts
cesarcesar is an unknown quantity at this point
exec() a php file

I'm trying to call a PHP page to run when called from another page. To do this it seems i have to use the exec() function. The code would go something like
Code:
// set pathing
$file = 'TEXT_small.m4v';
$localfile = '/user/dac420/incoming/'.$file;
$remotefolder = '/user/dac420/outgoing/';

// exec the file and pass vars. transfer.php for this example just echo's Hi to the motherboard.
exec('php transfer.php '.$localfile.' '.$remotefolder.' > '.$file.' &', $output, $result);
print_r($output);
print_r($result);
Running this code and few variations of it give me either empty $result and $output vars or this
Code:
    [0] => Status: 404
    [1] => Content-type: text/html
    [2] => X-Powered-By: PHP/4.3.9
    [3] => 
    [4] => No input file specified.
I have Googled "php exec" (and others) but I have come up with few reference. If someone can shed some light on this function or tell me where im wrong in my code i would appreciate it. Thanks.
cesarcesar is offline   Reply With Quote
Old 03-17-2009, 03:53 PM   PM User | #2
Fumigator
UE Antagonizer


 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 7,686
Thanks: 42
Thanked 637 Times in 625 Posts
Fumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of lightFumigator is a glorious beacon of light
You can't juse "include" transfer.php?
__________________
Fumigator is offline   Reply With Quote
Old 03-18-2009, 01:36 PM   PM User | #3
cesarcesar
Regular Coder

 
Join Date: Apr 2007
Posts: 144
Thanks: 5
Thanked 0 Times in 0 Posts
cesarcesar is an unknown quantity at this point
Include/Require will not work. I should have explained better. The page im calling via exec() is transferring 1G file between two servers. If this file is include()'d, the page will hang white until the transfer is complete. Therefor i need to create a separate php process to run in the background. This way once the transfer is started, the user can continue with their browsing without waiting.

The way to do this is with exec(). I just need to know how i went wrong. I think its pathing. Fu*^ing pathing every time! But maybe someone can help. Thanks.
cesarcesar is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:29 PM.


Advertisement
Log in to turn off these ads.