Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





External Processes Without Waiting For Return


In php how do I call an external script or program without having php
waiting for the return?

exec and system both seem to wait for the return, I don't want this.




View Complete Forum Thread with Replies

Related Forum Messages:
Waiting For Completion
I have written a little php script which creates a jpeg image based on MySql data (a pie chart). Calculations usually take up to 15 seconds and during that time the place where the picture will be in is shown as a broken link.

Can anyone tell me how to change this to show some 'Wait while loading...' message before showing the completed picture?

View Replies !
Executable Without Waiting
i want to run a backup of data and this may time a few minutes. is there any way of starting this task and not wait for it to end?

c:"program files"7-zip7z.exe a -tzip backup.zip datafile.dat -psecret


View Replies !
Waiting List
how i can create a waiting list? For example a user signs up, and then clicks the 'join' link. He gets put into a waiting list and updates are done every few days to let in new users.

View Replies !
Programmed Waiting In A Script?
In a script i would like to send many emails. So after sending a email i would like to wait a second then sending the next email. Now my problem is that i know the function how tell's the script to waiting a defined time.

View Replies !
Sending Mail Without Waiting
While using mail(), the php engine is waiting for the mail to be delivered and then proceeding to next step. Is there any way to skip this "waiting",
i.e. just send the mail, and dont wait for response and proceed to next
step?

View Replies !
Pause Code While Waiting For More Inputs
I was wondering if its possible to insert a while loop to wait while I get some form input from another window before proceeding PHP Code:

View Replies !
Launching Several CURL Posts Without Waiting To Download Pages..
Hy there, ok, i`ll get to the problem:

My php script has a function named curl(some curl options and instructions), it doesn`t matter that, what it matters:

$var1 = curl("http://www.somedomain.com/somepage1.php");
$var2 = curl("http://www.somedomain.com/somepage2.php");
$var3 = curl("http://www.somedomain.com/somepage3.php");
$var4 = curl("http://www.somedomain.com/somepage4.php");

Ok, so it downloades the content of somepage_.php to the $vars, however somepage_s_.php contains several scripts which takes a verry long time for the page to download, so my script waits for each page to download, one by one, as line by line, what i would like do rezolve is to start the curl without waiting to download the first page, then the second and so on, it should start the download of all the pages at almoust the same time. That would be all, please help, i`ve lost 4 nights trying to get this fixed but no luck.

View Replies !
PHP Processes
I have a cronjob triggering a php script that takes several minutes to accomplish. I need to prevent multiple triggering by the cronjob mulfunctioning. So I would like a clean way to know how many instances of a certain php are currently working on the server.

is there a server variable for that? if not, how do I know (via php) how many concurrent accesses are there to a certain php page? for example in mysql (the "SHOW PROCESSLIST" command), but I need a similar function for the php page iself.

View Replies !
Background Processes
I'd like to know how to send an external process to the background, so that I can run multiple instances of the same process at one time. Any tips, links.. etc?

View Replies !
Listing Processes In PHP
Using PHP, is it possible to return and display a list of currently running processes on the client's machine? In fact, is it possible to run a system command on a client's machine?

View Replies !
Automated Processes
Customers post 'projects' to my site. These 'projects' are closed after 10 days. I could run a script on the default.php page that detects this, but it seems a waste of resources to run it everytime someone visits the site. Is there a way around this, for example the first visitor to the site in any, say, 3 hour period, runs the script & switches the most recently outdated projects from open to closed?


View Replies !
Max Number Of Processes
how can i determine what the maximum number of processes i should open
with popen (or proc_open) is? i assume it'd depend on the hardware of
the computer in question, but if that were teh case, then is there a
way to get info. about it, and some general method to determine a good
number of processes to open from that info?

View Replies !
Stranded PHP Processes And ProcessExplorer
Does anyone know what it means if I see PHP processes in the process
tree at the base level, instead of under the IIS worker process?

I do nothing but web serving off of the box.

These processes that are not under the IIS worker process seem to be
stranded/hung. They are never cleaned up by any garbage collection and
I have to kill them manually. They also always have a fairly low memory
usage, potentially indicating that they fail before loading completely.

Could it be that the execution of the process fails early enough that
ProcessExplorer doesn't see them as being executed by IIS?

View Replies !
Handling Long Processes
I am building web app, that will run a long processs (image processing) that can porbably take 15-30 minutes to complete) in respond to a user request (the user clicks a "process" button on a php web form). The ideal situation that I see is once the user's request was recevied, a reply that says "you request is being processed.

we will send you email once finished", will be sent to the user, while the other process will take place. When it's finished, a callback function will be called that sends email to the user notifying him the process outcome. What are the options to implement that?
multithreading?

View Replies !
Shared Memory Between 2 Processes?
I have two running php processes (they have infinite loops) and I need them to pass some data to eachother. Writing and reading shared memory in one process works just fine but when I try to save var in process1 and read in process2 I get error: "Variable key 555 doesn't exist".

What I'm doing wrong?

//PROCESS 1 (saving var)
$key = 'My Key'
$value = 'My Value'
$app = 'lovelyapp'
$key = $key . 'a'
$segment_key = abs(crc32($app . $key));
$segment_size = 1024;
$segment_perms = 0600;
$shm_id = shm_attach($segment_key, $segment_size, $segment_perms);
shm_put_var($shm_id, 555, $value);
shm_detach($shm_id);

// PROCESS 2 (reading var)
$key = 'My Key'
$app = 'lovelyapp'
$key = $key . 'a'
$segment_key = abs(crc32($app . $key));
$segment_size = 1024;
$segment_perms = 0600;
$shm_id = shm_attach($segment_key, $segment_size, $segment_perms);
$value = shm_get_var($shm_id, 555);
shm_detach($shm_id);

View Replies !
List Processes Running In A Computer
I want to list all processes running on a computer by PHP language. Could you help me?

View Replies !
Insert Processes Before Form Is Submitted
I am trying to stop using Macromedia as my crutch and you guys have been a big help.  I need some assistance with submitting a form.  I have a form on my page and need to do an insert.  I have the action posting it back to the same page I am on versus sending it to an insert page.  The problem I am having is it trys to do the insert as soon as I pull up the page instead of waiting till the form is submitted.  I believe I need to do something with isset, but can't really find a tutorial that goes over it really well. Code:

View Replies !
Forking Multiple Processes At A Time
i have a php script that needs to execute an external php script (call this
script 2) when the user clicks a link, however I don't want the user to have
to wait until script 2 finishes executing before he sees the output of
script one... i know I can use the exec() command to do this, and use the &
to run the command in the background....

but say i want to run 100 instances of script 2 when the user clicks the
link (with different arguments)... i dont want to have all 100 processes
running at the same time... what I would like to do is run 10 or so at once,
and once those 10 are completed, run another 10...

View Replies !
Large Data Transfer Between 2 Processes
fist the context: I have a web server which query a mySql database. but
as the number of parralel queries increase, the server slows down too
much.

I got 2 ideas, one of which is to run N deamons which effectively
execute requests. the PHP uses message queuing(1) to queue queries
request to the daemons. but the answer may be quite large, larger than
messages the message queueing service can handle.

I thought to open back a communication link between the current daemon
and the waiting PHP to tranfer/process the result, using the message
queueing service to send back info regarding the opened link.

I thought to open a pipe between the current daemon and the PHP. is
this possible? and if so, how? if not, is an IP link to localhost be as
fast as a pipe?

View Replies !
Keeping Users Informed In Lengthy PHP Processes
Often PHP processes take a long time, such as wildcard searching a PostgreSQL database, or generating thumbnails.

The PHP host page does not display until the script is complete, so you can not effectively use code such as

echo "Converting file ".$Infile;
exec(convert $Infile $O8utfile);

for realtime feedback to the user.

How have others implemented a "progress meter" in PHP processes , one thought I had was to use Javascript redirection to call a PHP page with differing parameters each time .

View Replies !
Sending Signals To Processes As A Different User Than Owner Using Php
i know, it seems more to be a problem according to unix but i got it while
developing software with php:
i have 2 different users on a hp-ux machine that execute php scripts. they
are both in the same group.
these php scripts start background processes, i can communicate with using
signals (sending with posix_kill, starting background processes via
pcntl_fork).
so i got severel background processes owned by my 2 users.
the problem is i want to send signals as one of my 2 users to all my php
background processes no matter who of my 2 users is the owner. is it
possible other than using external tools like sudo?
i'm using:
PHP 4.3.4 (cgi) (built: Aug 18 2004 15:37:46)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

compiled with:
../configure' '--prefix=/usr/local/php-cgi-saprfc' '--enable-calendar'
'--enable-filepro' '--with-gd' '--with-jpeg-dir=/usr/local'
'--with-zlib-dir=/usr/local' '--without-mysql' '--enable-sysvsem'
'--enable-sysvshm' '--with-pgsql=/usr/local/pgsql' '--enable-trans-sid'
'--with-cpdflib=/usr/local' '--enable-sockets' '--with-ncurses=/usr/local'
'--disable-shared' '--with-tsrm-pthreads' '--with-saprfc=/usr/local/rfcsdk'
'--enable-pcntl

View Replies !
Max_execution_time Ignored, Multiple Apache Processes Spawned
I have an app that is going berzerk on its own; without any code or environmental changes of any kind, for some bizarre reason it will randomly just hang, spawn multiple Apache processes and completely ignore max_execution_time, literally running infinitely.

Using PHP 5.2.0, Apache 1.3 and Win XP

Is this normal "bizarre" behavior that can occur within this setup; if so, what workarounds have you found to combat this, other than the obvious (try to debug and fix code)?

View Replies !
Limiting The Number Of Spawned MySQL Child Processes
Need to know if there is any way to limit the number of spawned MySQL child processes in linux ?

I have done my research at http://www.mysql.com and have not been able to find my answer. Have also looked at the source code (what i can understand of it).

Using MySQL v.4.0.25-max. Using an older system and the 14 childern are just bogging the system down. I am the only one with access to the server so 14 childern is overkill.

View Replies !
Return 30 Or The Amount Of Actual Rows The Query Would Return If It Wernt For The LIMIT.
i have a query such as:

SELECT * FROM cars WHERE carmake='FORD' LIMIT 0,30

if i run a mysql_num_rows on this, will it return 30 or the amount of actual rows the query would return if it wernt for the LIMIT.

View Replies !
Checkboxes - Loop That Takes The Values And Processes And Writes The Changes To The Database.
I generate a form page from my MySQL database. let's say the table structure is:

Table A
> ID, title, active

the number of rows generated by the query is dynamic. If a field's value is 1, then the form output appears as

<input type=checkbox name=$ID checked> $title

and if not

<input type=checkbox name=$ID> $title

At the bottom of the form there is a submit button. The visitor can check/uncheck rows and then submit the form. I need to write a loop (possibly foreach) that takes the values and processes them and writes the changes to the database.

View Replies !
Mass Mailing Script/waiting For Script To Finish.
I have built a newsletter/mass mailing system that loads templates, supports multiple newsletters and mailing lists, etc. The problem I have is this:

I start a query loop which pulls the persons name and email address from a mysql database, populates the template for that newsletter then sends the message using the phpmailer class. The script takes ages (hours) to execute when your sending to 10,000+ people and so the window has to stay open till the script finishes. Is there a way to start this process running and continue script execution without having to wait for all the messages to go before finishing script execution?

View Replies !
Return False Or Return True
PHP5. Class, Member function.

"return false;" or "return true;"

When checked in the code invoking the method nothing is returned. If I change to "return(0);" or "return(1);" then it works fine, and the value is returned ok although obviously not technically a boolean. I have tried all sorts, from

if ( memberfunction() ) {
if ( $val = memberfunction() ) {
$val = false;
$val = memberfunction();
......

View Replies !
Build A Page That Takes Form Data, Processes It In A Second Page
I'm trying to build a page that takes form data, processes it in a second page, then sends the user to a third,depending on data processing.

On the second page, I am trying to get the page to have some sort of "Loading" message while the backend processes the data, but I can't seem to get anything to work. Does anyone know how I can get that Loading message to display?

View Replies !
Sessions? External Program / External Program
I am trying ac ouple of days now to learn some things on SESSIONS,but I think I am not getting it very clearly. I have a PHP page tha contains a form.

Users enter data in the form, which are then written in a file (the file is created at the time a user enters some data) The file is then given as an input to an external program The external program runs and gives some results which are then stored in another file (that is created when the external program finishes) What I want to do is to somehow create these files and, when the user exits from the browser, then both files that refer to this user, will be deleted. Code:

View Replies !
Form Processing - Create A Form Processor With Processes The Form To A Page
I have searched the internet for this. I want to create a form processor with processes the form to a page which only certain people can access. I got everything down but the form processing. Does anyone have this code or can you lead me to the right direction?

View Replies !
External Url
I have tried to make a script, that checks the external url from a popup, but i just get permission denied in javascript. But can this be done in php?

View Replies !
Getting External Ip...
how would I get the External IP of the computer running the php script, and store it in a var named curIP?

View Replies !
External RSS
I am using PHP to parse some RSS feeds that appear on my home page. The problem is, if one of these feeds hosts is slow, it slows down my page load time. Is there a way to set a time out, so if that RSS feed isn't loaded within a certain it can be skipped.

View Replies !
Loading External Dll
I extract the php-4.0.4pl1-Win32 into my local PC C:php directory. I follow all the instruction in install file and find that the php script work. Then i go to uncomment the entension for external dll that needed in win.ini and also change the path extension_dir=C:phpextensions.

the problem is each time i load the php script, it will prompt out the error message "unable to load dynamic library "c:extensionsphp_oracle.dll". can some one help me to resolve this problem?

View Replies !
External DOMEntity's
I have a question about PHP5's DOM, but I found the docs on this section are either incomplete or incorrect (e.g. wrong return types for several functions). How can external entities, or entities in general, be added to a DOMDocument? (I'm not asking about adding entity references because DOMDocument->createEntityReference works like a
charm.)

I should probably state the details around the problem: I am working on a templating engine that utilizes PHP5's DOM interface (http://xire.forizon.com for details) so for caching purposes if I can make the output document include cached versions of other templates via external entities (XInclude is already used, but not it isn't supported
very well on the client side), then any client-side caching can also be utilized.

View Replies !
External PDF File
Is there a way for me to be able to fetch a PDF from another site and display it on my website without having to open up Adobe Reader?

In other words, I would like to have this PDF document: http://flightaware.com/resources/airport/ASE/APD/AIRPORT+DIAGRAM/pdf

to be displayed on a page when a user opens a page on my website.

View Replies !
OO External Template
I am trying to figure out how to make an external .tpl file with all the HTML and call it from the Object. Code:

View Replies !
Url In An External Php File
Situation: I have an external php file with a function in it that returns a value with document.write like this:

<?php
Header("content-type: application/x-javascript");

function myfunction()
{
return $something;
}

$some_variable=$something;

echo "document.write("Some_Text: " . $some_variable . "")";
?>

When called remotely by javaScript, the php function behaves perfectly returning the desired variable:

<script> type="text/javascript" src="http://www.mydomain.com/remote.php"></script>

The Problem:

I would like to display the "Some_text:" part with an active link as in
<a href="http://www.yourdomain.com/">Some_text</a>

So that when executed, the JavaScript displays the link with an anchor text. How can I write this code into the echo document.write function?

View Replies !
External JavaScript
I am using phpBB and wanted to display latest poll in phpBB to my home page. My home page is html extention and want to use java to call it and display it. I am stuck with these codes;

php codes;
<? php
SOME, SOME....
{
echo "document.write('$poll['options'][$i]['vote_option_text']');";
} ?>

if ['options'] then will not print anything, if I remove ' ' then print something. However if I put all 4 items ('$poll['options'][$i]['vote_option_text']');"; without ' ' inside of [ ] it will print like;

Array[0][vote_option_text]Array[1][vote_option_text]Array[2][vote_option_text]Array[3][vote_option_text]Array[4][vote_option_text]Array[5][vote_option_text]

What is correct syntax?

View Replies !
Getting External Data
I am logged in to Yahoo with my Yahoo ID, and I visit:

http://baseball.fantasysports.yahoo.com with my browser, it will tell me which Fantasy Baseball leagues I am in, and allow me to click on one to enter the league page.

I figured therefore, that if I were already logged in, that the following code, would display the same page (i.e. I would be able to see which leagues I am in):

$remotefile=fopen('http://baseball.fantasysports.yahoo.com/','r');
while (!feof ($remotefile)) {
$line = fgets($remotefile);
echo($line);
}

Unfortunately, the resulting page asks me to sign in, and doesn't display the desired leagues. But I AM still logged in to Yahoo. If I were to try to visit:

http://baseball.fantasysports.yahoo.com again in my broswer, it knows I'm still logged in and displays my leagues.

View Replies !
External Program Via PHP
I need to execute a command-line program through PHP. I have a form which includes a textarea, where the user writes his data. These data will be used as input for the commend-line program. Will I go something like:

$data = $_GET['info'];

Which function shall I use? System, exec, shell_exec, passthru? I can't choose which one is the correct. By the way, the command which I use when I write the script in the command line is :

program_name [argument1 -> A database file] [argument2 -> info supplied by user]

So, in the function that will be used, the data supplied by the user will be passed as my second argument (the 1st argument is a file in my hard disk). And, lastly, do I need to change any global settings for PHP in order to perform such actions, ie running scripts via PHP programs?

View Replies !
External Banner
we are building a large agency website and are looking for a php code that a agency can copy to their website to display our banner so they get their free account, in our admin panel we want it to automatically check our code is on their site and as soon as it is removed it changes status. Maybe in admin it shows green button when it is on and when it is removed changes to red, as we have far to many to manually check daily.

View Replies !
External Programs
I have just installed my first Linux distribution (SUSE 10.0). Everything is compiled as far as Apache, Mysql & PHP is concerned. But, I have this problem: I call system commands through PHP using system, shell_exec etc The thing is that PHP responds OK when it comes to 'ls' or 'grep' or 'wget', but, in another program, not UNIX-native, there is no response. I am sure that the program is set up in the PATH, because, if I open a terminal, I can call it from everywhere and it works fine.

View Replies !
External Variables
It's probably not called an external variable... but this is what i need. I have a new design that uses a template... so it works like this:

call up index.php (containing variables like content), this includes the template.php (includes the "backbone"). Now the template also calls up a few other pages (like the header, sides and bottom) but I need it to call up something else.. Code:

View Replies !
How To Run External Program
i would like to use php to run external program in window environment like open a macro program to let it run at window background.

I try to use exec to run the window command, it works, but when i try to use exec to
run other program, like this..

exec("run xxxx.ttl") // xxx.ttl is a macro

the php will hang... anyone has sample on how to use php to run external program in window environment??

View Replies !
External Script
I have a script which reads a data file, reads the characters one by one and if a certain character is meet it does something else, at the moment it echos the fact that it meet a certain character. I need it to take the characters it has read up to that point and present them to a database field thats forms part of a set of fields that will be updated at once. Then it will continue to read the remainder of the file and
repeat the process until it reaches eof. Is there something similar to goto or gosub, I did some checking and was laughed at, as you can probably tell I'm a newbie. Maybe I should be calling an external script.

View Replies !
Output As External XML
the following code runs a query on a database and outputs the results as XML within its self. I have attempted to get the php page to create a file called rss.xml but have failled.

I have tried using $file= fopen("rss.xml" , "w"); but my knowlege of PHP wouldn't be the best or anyway near to the level of being able to modify the below page to do as i wish, would someone be able to take a peep at the page Code:

View Replies !
An External Checker(-script) For A CMS???
I am looking for a way to check all external links on a website on deadends.

View Replies !
How To Make Sure External URL Is Reachable?
Is there any simple method in php to determine if a url from a website is reachable?

This is so that if your website has to load content from another URL, is there a failsafe method for the other parts of your website to load even if that one part is down?

View Replies !
XML Form Post To External URL
I'm far enough along in PHP to know how to create input forms, grab the form input as $_POST variables, do some basic validation checks and present the errors to the user for resubmit if needed. For the life of me I can't understand why I can't post data as an XML document to one of my advertisers.

For example, a lead form is complete with Name, Address, Phone, and so on. I capture the form data and submit as an XML document. This particular advertiser will only accept data as an "External XML Post." I tried using Javascript and PHP with cURL, but I'm going in circles trying snippets of other people's code -- it's been a week. At this point all I want to do is assume IE7 (nothing else!) and no data checks, just "here's the XML, here's the external URL" and show me that HTTP POST actually works. Right now I'm thinking it's a bunch of junk :-) Someone please help.

Here's my server info:

PHP Verion 4.4.4
Apache/2.0.46 (Red Hat)
CURL support enabled
CURL Information libcurl/7.15.4
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20510
HTML Support enabled
XPath Support enabled
XPointer Support enabled
XML Support active
XML Namespace Support active

Here's a sample of XML, let's call it "data.xml"

<?xml version="1.0" encoding="UTF-8"?>
<DataFormSubmit>
<individual id="12345">
<FirstName></FirstName>
<LastName></LastName>
<Address></Address>
<Phone></Phone>
</individual>
</DataFormSubmit>

POST XML document to URL on an external website for example:
http://www.example.com/othersite/xml.aspx

Response XML is equally simple. There is no mention of MethodCall, MethodResponse and Params like the books say, so please don't use those elements in your reply to me. There is mention of field requirements like "Text field" "255 character max" "Numeric" but I think this can be handled by the input validation scripts. I'm just trying to POST and get a response.

I've received errors refering to "permission denied" "access denied" "object expected" but at this point I've edited my code so many times I don't know what's right or wrong any more. Here's one of my failed cURL examples:

<?php
// XML data as string
$request = '<?xml version="1.0" encoding="UTF-8"?>'
$request .= '<DataFormSubmit>'
$request .= '<individual id="12345">'
$request .= '<FirstName></FirstName>'
$request .= '<LastName></LastName>'
$request .= '<Address></Address>'
$request .= '<Phone></Phone>'
$request .= '</individual>'
$request .= '</DataFormSubmit>'

// Create Headers
$header[] = "Host: www.example.com";
$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($request) . "
";
$header[] = $request;

// Send using CURL
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, "http://www.example.com/othersite/xml.aspx"); // URL to post
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); // return into a variable
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header ); // headers from above
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' ); // special POST with specified Content-type
$result = curl_exec( $ch ); // runs the post
curl_close($ch);

echo $result; // echo reply response
?>

And I tried a Javascript variations using code like
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") but I'll save that for a followup post since this is getting long.

Anyone out there doing external XML form post?

View Replies !
Is There A Way To Interact With External Webpages
I don't know if this can be done using php (I'm hoping). I need to
automate passing a variable from a text file to an external webapge
(that is not mine). Basically, simulate a user entering a number into
a textbox and then activate the submit button.

The webpage in question has a textbox named 'serial_number' and a
button named 'submit'. I would like to pass a numeric value to the
serial_number textbox and then activate the submit button. Can this
be done uisng php? If not, does anyone know of any method to do this?

View Replies !
Formating External Text
I have a quick question about the formatting of external text files.

I am trying to make a webpage for a local church that will display what
is on in the coming weeks. I have done this using an external text file
so that the future users will never have to modifiy the page itself.

If left as plain text, it shows on the page in default format. I know I
can format the text within the text file using standard HTML, but is
there a way of formatting regular text outside of the text file? Kind
of post processing it? The file format will always be something like

Monday 19th
09:00 Add event here
12:00 Add event here

Tuesday 20th
09:00 Add event here
10:00 Add event here
13:00 Add event here

etc...

The number of events on each day is variable, and not every day may
feature (could be monday events then thursday events). I would like to
make the Day and date bold, the times italic...well you get the idea!

I have an idea that I will need to impose a structure on the file,
however I am unsure of how to do this. If this is the case, then I
would appreciate it if someone could post a link to a decent tutorial
or guide so I can learn it!

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved