Re: curl_exec won't return (any data)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 8, 2011 at 7:50 AM, Tolas Anon <tolas777@xxxxxxxxx> wrote:
> On Tue, Feb 8, 2011 at 1:35 PM, Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx>wrote:
>
>> On Tue, 2011-02-08 at 13:24 +0100, Tolas Anon wrote:
>>
>> > Hi..
>> >
>> > For a set of media import routines, i'm using a
>> > javascript->php_on_apache->windows.bat->php_cli->curl->php_script
>> invocation
>> > method.
>> > It seems longwinded, but it's designed to have different parts of the
>> import
>> > process run on different servers.
>> >
>> > I'm stuck at getting curl_exec() to return the data of the final
>> php_script
>> > that does the importing.
>> > The script itself runs fine, and i've recorded good details that
>> curl_exec()
>> > is supposed to catch with file_put_contents("/some/debug.txt",
>> > json_encode($returnArray)), and from those debug-printouts it's just a
>> few
>> > tiny steps towards a cascade of "return" statements, followed by a
>> > echo(json_encode($returnArray)) and a normal end to the php_script at the
>> > end of the call chain.
>> >
>> > However, curl_exec() seems to hang completely. I've added over a dozen
>> > "debuginfo -> file on server" statements, and the one that should fire
>> > straight after curl_exec() does not fire.
>> >
>> > It does this only with large (1.8gb) video files, a smaller (60mb) video
>> > file doesn't produce this problem and the entire import routines work
>> fine
>> > then.
>> >
>> > I'd very much appreciate any tips you might have for me.
>>
>>
>> Let me see if I've got this right.
>>
>> The windows.bat is processing the media file somehow, then calling a
>> php_cli script which makes a cURL call to another web-based PHP script?
>> Is this right? The final script I assume is getting sent some info from
>> the cURL call and is using it somehow (in a DB maybe?) before some sort
>> of message back to your curl call. What is the code then doing with it
>> after that?
>>
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>>
> oops, i missed a step (php_daemon_script) in the chain of calls;
>
> it's : javascript -> php_on_apache -> windows.bat -> php_cli ->
> php_daemon_script -> curl_exec -> php_script
>
> followed by calls-until-finished from javascript that read the status of
> php_script via json files written to the server and thus display the status
> to the end-user..

1: java event
2:java event calls a php function to apache.
3: which calls a window.bat
4: calls a php command line
5. calls a php daemon, which is a 'waiting server process', listening
on on a port.
6. you execute a command line statement
7. and it's for a php script to return something

>
> the windows.bat just starts up cli-php with admin privileges, which executes
> the php_daemon_script, which uses repetitive curl calls to the import-script
> ("php_script" at the end of my chain) that does all the work for a single
> item in the total upload/import queue;


 it does video conversion with
> exec(/path/to/ffmpeg), photo conversion with imagemagick, and updates the db
> with the php adodb library.
> php_script at the end of it's work returns a simple and short status array
> (json_encode()d) to the php_daemon_script via curl_exec, that dictates if
> the php_daemon_script should continue calling the (import) php_script more
> times.
>
> it's curl_exec that hangs/freezes, both with using CURLOPT_RETURNTRANSFER=1,
> or capturing output with ob_start() and ob_get_clean(). i've gathered that
> much from my custom debug logs.
>

What do you have at the beginning, and what do you want at the end of
this process. Break it down into simple steps. And then not only can
any php programmer help you, but any computer scientist can help you
utilize the control flow logic.


-- 
According to theoretical physics, the division of spatial intervals as
the universe evolves gives rise to the fact that in another timeline,
your interdimensional counterpart received helpful advice from me...so
be eternally pleased for them.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux