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.





Creating Or Simulating A A Process Fork On Windows


IS there anyway of running two or more scripts seemingly simualtaneously?? PHP is installed on a Win 2K machine.




View Complete Forum Thread with Replies

Related Forum Messages:
Want To Spawn Process From Windows PHP
I wanted to write some code purely on Linux, but unfortunately the
document scanner drivers are non-existent for the high-end commercial
document scanners. So, I had to port my Linux PHP project to Windows
PHP (WAMP). There, I found a scanning tool (Kodak Image Scan -
imgscan.ocx) that I can put on a VB form, tell it to scan some
documents into a TIF file, and then shut down.

I can run this VB app at command line just fine, but when I run it from
either a popen(), system(), or exec() call, it won't detach from the
PHP page. Instead, it just sits there. I can see the VB exe I made is
being loaded properly in RAM, but unfortunately it sticks and won't
unload on its own, nor will it tell the scanner to engage. I have to
kill the VB exe and then the PHP page continues.

What's the way to spawn a detached process from PHP on Windows?

View Replies !
Process Management In Windows
All I need to do is run a windows batch file from a small php program, and
return the windows process id of the batch file. I have played around with
proc_open() but that returns a resource id. Does anyone have a suggestion
on what call I could use to get the windows process id returned within my
program. I am using windows xp pro, and php 5/apache

View Replies !
Calling PHP From A Windows Process
I'm calling PHP from a windowsprocess in a simple Webserver application. I'm using the createprocess Windows API command....

C:PhpPHP Filename.php

In this file I will open a TCP/IP connection to my SQL-server. When I do so, I always get the following error
mysql_connect(): Can't create TCP/IP socket (10106)

No I start a command shell and I call the same...
C:PhpPHP Filename.php

This will work without any error!!

Same effect I get from all TCP/IP Actions (FTP etc....)

Can somebody help me. Is it a PHP Setting, a server variable or a WindowsXP Access right problem?

View Replies !
Possible To Check To See If Windows Process Is Running From PHP?
I need to check the state of a processes from within a PHP script on a
Windows machine. All I need to know is whether or not the process
exists (i.e., is running). Anyone have any ideas?

I searched the archives and found proc_open(), but if it can do what
I'm trying to do, I can't figure out how.

View Replies !
Shell_exec Background Process *Windows*
I am trying to get a shell_exec command to run in the background. So far I have tried:

$ret = shell_exec($ffmpegcmd1." >NUL 2>&1");$ret = shell_exec($ffmpegcmd1." >NUL 2>&1 &");$ret = shell_exec($ffmpegcmd1." >NUL");

without any luck.

View Replies !
How Does PHP5 Process POST Data In Creating $_POST Array?
I need to save a wav file that is HTTP POSTed to a php page.
What does PHP5 do automatically to a POSTed variable when it puts it in
the $_POST[] superglobal array? I haven't been able to find any info on
this....

I have a script that does what I want in PERL, but I need to do it in
PHP.
I think the PERL does something magic when it does this:

#### PERL CODE ####
read ( STDIN, $buffer, $ENV { 'CONTENT_LENGTH' } );

@pairs = split ( /&/, $buffer );

foreach $pair ( @pairs )
{
($name, $value) = split(/=/, $pair);

$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

$FORM { $name } = $value;
}
#### END PERL CODE ####

View Replies !
Simulating Users
What I need is to simulate 5000 users on the system that are doing different kinds of tranasctions on the database at the same time and run 2 different triggers and measure the execution times of each one.

i have no idea how can I do that. Is anybody had any experience in this area or any idea?

View Replies !
Simulating Post
if theres something similar in php to libwww in perl

$f = HTML::Form->parse("http://www.example.com/index.html");
$action = "http://login.example.com/login.cgi?etcetcetc=";
$f->action($action);
$f->push_input("text",{email=>"email@email.com"});
$f->push_input("password",{password=>"pw"});
$f->click

so i can login via a simulated post from php rather than through a form.

View Replies !
Simulating A Keypress..
My linux box has a tv card, and I'm able to stream a live tv channel. I can watch that channel from anywhere there's an Internet connection.

One thing I'd like to able to do is change channels remotely. Currently, I can change channels directly on the linux machine's keyboard by pressing the UpArrow. But I want to be able to do same remotely.

My question then is, is it possible to programmatically simulate a keypress using php?

View Replies !
PHP Fork
I would like to have a fork in my PHP code - the coding will branch with 2 possible options to execute (2 possible web contents to show). Which one is executed will depend on a certain changeble ratio factor. So, for instance, if the ratio is 3:7:

if the PHP code is called 10 times - 3 times option 1 will be run. 7 times option 2 will be run. how can I go about coding this. I really haven't got a clue how to implement this ratio (probability) control.

View Replies !
Fork
I would like to have a fork in my PHP code - the coding will branch with 2 possible options to execute (2 possible web contents to show). Which one is executed will depend on a certain changeble ratio factor. So, for instance, if the ratio is 3:7:

if the PHP code is called 10 times - 3 times option 1 will be run. 7 times option 2 will be run.

My Q is - how can I go about coding this. I really haven't got a clue how to implement this ratio (probability) control.

View Replies !
Simulating Multiple Connections
Is there a program out there where I can simulate multiple connections to my Access database via ODBC?

I'm using web forms and PHP to access Access via ODBC to achieve my transactions. Is there something out there that I can use to simulate multiple connections?

View Replies !
Simulating Form Submissions
I would like to add 250 users to a Wordpress blog of mine. The code to add a single user via a form is below. Assuming I could write the code to take names, passwords, etc., from a CSV file, how do I simulate submitting the form 250 times? php:

<div class="wrap">
<h2>Add New User</h2>
<p>Users can <a href="http://www.baklava.org/blog/wp-register.php">register themselves</a> or you can manually create users here.</p><form action="" method="post" name="adduser" id="adduser">
<input type="hidden" name="_wpnonce" value="0df235c514" /><input type="hidden" name="_wp_http_referer" value="/blog/wp-admin/users.php" /> <table class="editform" width="100%" cellspacing="2" cellpadding="5">

<tr>
<th scope="row" width="33%">Nickname <input name="action" type="hidden" id="action" value="adduser" /></th>
<td width="66%"><input name="user_login" type="text" id="user_login" value="" /></td>
....................

View Replies !
Simulating A Form Post
If I want to simulate the effects of a form (I.e., populate the POST variables) without using a form and actually hitting submit.

View Replies !
Max_execution_time And Fork
I use recursive readdir as the engine for
a numerous file processing routines, including
generating thumbnails, using getimagesize
imagecreatetruecolor and imagejpeg, etc.
where each resize operation involves instantiating
a new resizer class instance.

.....but my (shared host) website is large, so I
run past max_execution_time if I try to make
all thumbnails at once, from the top of
my document_root. My virtual file system
includes a php.ini which I can edit, but
bumping max_execution-time (although the file saves)
seems to have no effect, and I do not have
permission to run /usr/sbin/apachectl restart

Perhaps the php.ini change
will start to work the next time the server reboots.

In the mean time, is there some way to fork a new process,
for instantiating the resizer?

I could try to use exec to run command line
php. But there must be a more elegant way
to do this. I'd use perl and imagemagick,
but my shared host server doesn't have the
right perl libs installed, and that's another
can of worms.

View Replies !
'fork' A Session
I am working on a webbased application (not a website) and from a page a new instance of the browser is started (using javascript) offering a different set of functionalities. What I want is that each new instance of the browser continues with its own set of
sessionvariables, as two different sessions. Is that possible? I use the following javascript function:

window.open('code.php?submit=new&id=1,'status=no')

I use session_start() at the beginning of every page, i also considered using session_regenerate_id in various ways but this didn't have the desired effect.

View Replies !
Simulating Object Upcasting To An Interface In PHP 4
In Java one is supposed to upcast an object to its interface whenever
appropriate:

MyInterface customers = new MySpecificClass();

The idea is that if later one wants to change the specific
implementation one only has to change a few lines, possibly just the
one line above. Thus the code becomes more flexible.

Is it right to say that there is no way to do this in PHP? I've taken
to simulating the same by using one object as a mask that sets and
then uses another object:

myMaskObj = new MaskDatabase();

myMaskObj->setDbObj("DatabaseObject");
myMaskObj->query("SELECT * FROM content WHERE type='comments'");

MaskDatabase has a method called "query" which simply passes the query
along to DatabaseObject which also has a method called query.

View Replies !
Simulating Include Statement With Html Only
Is there a way to simulate the php include() statement in html that does not require php but only html?

I have a bunch of html files that all have the exact same navagation coded into each file. I want to move the navagation code to one file and then include it into the html as the page is requested.

I have done this sucessfully in the past by inserting an include() statement inside php tags and running the html page through the php interpeter.

Problem is that in this case I don't think that the host will let me run those html files through the php interpeter.

I have looked around in html at some of the tags that are not sure as much and as yet havn't found a way.

View Replies !
Exec(): Unable To Fork
I am trying to use exec() on windows IIS ,but i get the following error Code:

Warning: exec(): Unable to fork [html2pdf.exe "http://www.yahoo.com/" "yahoo.pdf"] in c:inetpubwwwrootoctsuppublicationpublicationreport2.php on line 62

and the code that i used is Code:

<? $convertpdfprg="html2pdf.exe "http://www.yahoo.com/" "yahoo.pdf"";
$checkvar=exec($convertpdfprg);?>

View Replies !
Fork - Run A Script In The Background
What is the best way to fork without using pcntl_fork()?

I've tried something to the effect of:

exec('script.php arg > /dev/null &');
But it seems to do weird stuff instead of what I actually want to do.

Is there another way I can run a script in the background, without having to wait for it to return for the parent script to continue?

View Replies !
Include() Fork Bomb
I'm a sysadmin who runs an apache server with PHP. Recently, one of my users accidentally created a fork bomb by creating a php file that includes itself. Is there a way to detect when someone has done this and prevent it from infininite recursion.

View Replies !
Unable To Fork Exec()'d File In IIS 5.1
I am repeatedly trying to execute a file on my server using exec() or passthru() and I keep getting an Unable to Fork error. Has anybody else had a problem with this in IIS?? The path to the perl script is correct and the script works fine in the C: prompt.

View Replies !
Using Form To Post Info And Pic's (Warning: Unable To Fork)
I have created an admin form which allows the admin to update info and pic's to his site but I am having trouble with the update_pic script. When I pass along the form to the php script it gives me the following error message:

"Warning: Unable to fork [C:WINDOWSTEMPphp30.tmp /full/path/to/joesauto/images/anime_dvd_icongif.gif] in c:inetpubwwwrootadd_data.php on line 39"

This is line 39: exec("cp $picture /full/path/to/joesauto/images/$picture_name");
This is the form I used which was taken from this site. Code:

View Replies !
Running An .exe File Using Exec() Or System(), Unable To Fork Error
I have a problem with running an .exe file using exec() or system() I have downloaded a file called ffmpeg.exe for converting movie clips. I can use the program thourg the command line in windows (cmd), but I'm not able to have PHP run the file. First PHP gave be an "unable to fork" error. But then I gave users access to the cmd.exe file and solved that problem. So now is no problem running for example exec("dir");

View Replies !
Exec() Function Warning: Unable To Fork (Access Violation At 77F81B4D)
I am trying to execute a DOS command with the exec() function. All I get is fork errors or access errors, regardless of what file I try to execute. Example:

<?php
exec("sync.bat");
`sync.bat`;?>

Warning: Unable to fork [sync.bat] in C:testexec.php on line 3
Warning: Unable to execute 'sync.bat' in C:testexec.php on line 4
PHP has encountered an Access Violation at 77F81B4D


Id doesn't seem to matter what kind of file I try to execute, .exe, .bat or .com. Any ideas? Has ANYONE executed an external program under php/Windows?

View Replies !
Error Handling - Simulating A Memory Error
I'm simulating a memory error. I set the limit to 1 Mbyte so when this code is executed an error should appear

ini_set("memory_limit","1M");
...
echo("before");
$img = @imagecreatefromjpeg($tsrc);
echo("after");
header("location: http://...");

When I run the script the result is the text "before", it seems that the execution is blocked at $img = @imagecreatefromjpeg($tsrc);. Do you have any suggestions? any missing configuration?

View Replies !
Is It Possible To Authenticate Users Running Apache On MacOS X (with PHP 4) And An Active Directory On Windows 2000 Or Windows XP?
From a PHP webpage, is it possible to authenticate users running Apache on MacOS X (with PHP 4) and an active directory on Windows 2000 or Windows XP?

View Replies !
Process ID
I am starting a process with the system command via a php page. I want
to put a button on the same page which will let the user kill the
process by clicking that button. To do this, I need to know the process
ID. I could grep for it, but that also returns the grep command. How can
I make PHP tell me the process ID of a process I started? It seems as if
this would not be a problem but I guess I am missing something.

View Replies !
Getting Your Own Process ID
I am doing some work where I want to do locking, and prevent scripts from
running in parallel. I see that I could use the semaphore mechanism, but
I'd like for my code to be portable, and that extension is not enabled in
many places.

I need some way for a process to uniquely identify itself. It can then look
at the storage container (flat file, DB, whatever is appropriate in
context), check to see if the requested semaphore is available, and if it
is, acquire it and then mark itself as the owner. It can then check that it
did in fact get ownership (as opposed to another process which attempted to
acquire it at the exact same moment) before proceeding. Code:

View Replies !
Process Name
How do you send a variable with a php process name? I have one script that different websites are running in the background. I want to be able to identify which website is running which process of the script.

/usr/bin/php /home/thescript.php - domain1.com
/usr/bin/php /home/thescript.php - domain2.com

View Replies !
Run Process In Background
I want to run process from my php script in background.
I try different functions from functions list but all of them whaiting for
process ending. How can I run `wget -b ...` and finish my script, but wget must still working? I use PHP5, Linux, Apache2.

View Replies !
Multithread A Process
can i use php to multithread mail() or something similar? in my company
i need to send multiple copies of email to a few hundred ppl affilated
and on my list.

instead of calling mail over and over again i would like to thread this
process.

could someone point me to some documentation or perhaps an example of
where to start with this?

View Replies !
Fetch & Process
I doing a straight forward webpage fetch and saving it to a file: CODE:

$open = @fopen($url, "r");
$urlfile = @fread($open, 50000);
@fclose($open);
$page = split("",$urlfile);
$datafile = fopen($tempfile, 'w');
foreach ($page as $line) {
echo($line);
fwrite($datafile,$line); }
fclose($datafile);

So I basically just write the fetched HTML line by line to a local file. The weird thing is I'm getting a bunch of ^M characters in the final file after every $line is written to the file.

View Replies !
PHP Process Problems
I'm having problems with php process in win2k. I have apache+php intalled on a win2k machine and after some use I can find 1,2 or 3 non-terminated process in the system. I try to kill them but I receive access denied (even logged as administrator :confused, and I have to reboot the machine.

While I have 1 non-terminated process, I have no problems. But when it reaches 3 process php scripts doens't work anymore. If I try to load a page, it doesn't execute the scripts and the browser keeps waiting forever. What maybe the problem? Why can't I kill the process?

View Replies !
How To Process .htm Files As If They Are .php
I will like to process all HTML files as PHP files. I am using Linux and PHP 4.

View Replies !
Process Form Twice
I have a basic form on one website. But the way it is setup is once the submit button is hit it takes them to a different site where the form is processed. Is what I need to do is have a way that once the submit button is hit I need to save the persons name only in a text file or something then have it go to the other page to be processed. Does that make sense.

i know how to save the info from the form to a text file but don't know how to have it do both, save the name and then take the user to the other page where the registration form is processed.

View Replies !
Trouble With A Php Process
I have set up a form and when I click on submit I get the following error message:

Warning: fopen(admin/data.dat): failed to open stream: No such file or directory in /home/mlkphoto/public_html/process.php on line 33

Warning: fwrite(): supplied argument is not a valid stream resource in /home/mlkphoto/public_html/process.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /home/mlkphoto/public_html/process.php:33) in /home/mlkphoto/public_html/process.php on line 39

What does this mean and how do I fix it? I do get the form information sent to my email so I know it's going through. I just can't get a "Thank you" page to come up and I get the error messages.

View Replies !
Process This Form
I want to have a form which has several rows for example:

username1 firstname1 surname1
username2 firstname2 surname2
username3 firstname3 surname3
username4 firstname4 surname4

What I want to do is when this data is typed into the form to save it in a MYSQL db. The problem isn't with the saving, it's with the form itself. What is the best way to process this?

I can't really name the various fields "username1" and "username2" because I would then need to replicate these as variables and this form generated could have an number of rows so hard coding the form field names with numbers makes it hard. Is there any way I can do this?? How have other people tackled this sort of thing in the past?

View Replies !
PHP Load Process
I've tried searching around for information on how PHP parses and renders itself.

Basically, I'm writing a bunch of scripts that rely on a core file. The core itself is quite large (around 20k), but the scripts that reference it don't often utilise the entire contents of the core.

Inside the core are functions that are never called *inside* the core, and a bunch of constants and globals that I call from the referencing scripts.

So I guess in a nutshell, I want to know if when I call require, does PHP read the *entire* file? Or does it only read the bits it needs? I realise that last sentence makes me sound like I have trouble putting legos together, but I would just like to know how PHP goes about it duty.

View Replies !
Hanging Php Process
I am running a php site on a shared host environment. They have 20 max concurrent process limitation. Recently, I am having issue of some phpcgi process just hanging there and my site run out of process quota.

the time limitation in php.ini is 180 seconds. However,those php just doesn't quit after 180 seconds, I check ps result. seems all those process just consume 0 seconds of CPU which explains why it didn't get termiated? It just didn't finish properly. what kind of things will cause process stay there? if I didn't close mysql connection,not free up result, will that cause it?

View Replies !
Image Process
I start learining php this week , and I am wondering if anybody knows if we can access to a picture's pixel using php.

View Replies !
Process A BIG String
i need to process every character in a file, so i open the file read
in buffers of about 8192bytes and process each buffer, then i write
the output to another file.

the problem is that with large files(>8Mb) i get a script error(Fatal
error: Maximum execution time of 30 seconds exceeded ).

i acess every character in the buffer with
$chr=ord($bufferIn{$i}); (where $i=0...8192)
seems like all he time the script consumes is in the for loop and the
chr/ord functions.

can i do something to speed things up?
is there any other way of acessing a single characher except
$bufferIn{$i} ?

View Replies !
Mysql Process Cpu 106%?
Im in real trouble here I have a new social networking site similar to myspace, I just opened it to the public today and it has only around 80 users so far and with like 20 online i get this mysql process cpu 106%.

View Replies !
Background Process
I would like to create a script that acts like a background process. Basically once every hour, it will access a website, gather data from it, and write that data to a file on a remote server. The PHP code would be running on this same server. Is this type of non user activated, constantly running code possible?

View Replies !
Forking A Process
What i should i use to create a script that does two things at the same time ie while sorting/execeuting a process, how can i show another screen with valid data on it?

View Replies !
In-process Display
Is there an easy way to do either of the following in php? display basic content while the php script is running through a extended loop, then when the loop completes, replace the basic content with final content; or have two pages, one with the basic content that checks with the longer running script and redirects to it when the latter is complete.

View Replies !
Code Process
This is sort of a general question, as I'm not 100% sure of the answer. Exactly in what process/order does the php code in a script get processed? I ask this as I have a simply gaming site, and things have been going until just recently, the cause being. I have user playing that is on dial up. Since this user is on dialup, he is constantly either timing out, or getting dropped/losing his internet connection. And the result is that I am getting sql errors on queries that can't process because the code didn't complete before he was dropped.

View Replies !
Control Process
i'm looking for a way to:

1. start a new process (exec(), proc_open(), popen(), whatever())
2. sleep(some_secs);
3. if the process is still running, kill it.
4. otherwise, go to 1.

any ideas on this?

View Replies !
Cannot Process Forms
I have installed PHP several times using tutorials and information from
a book, but each time I am able to use basic functions, such as date(),
but when it comes to processing forms it shows up nothing.

I know it can't be my programming as i have copied the book word for
word and even use the example from their website.

All i am trying to do is send information from a HTML form to a PHP
page which will then display what was entered into the form. The code i
have used on the PHP page is shown below: Code:

View Replies !
Understanding The Process
I need to understand the process before I start coding. I have a database that contains the following:

Item Number
date
Account Number
Quantity
Total value

only if you combine the Item Number date and Account number will it be unique. What I need to do is the following I need to extract all the data for a curtain Account number or a range of account numbers for a curtain date range, I need to add up all the quantities from all the date ranges for the individual Item numbers per account numbers.
The add the quantities from the range if account numbers for the individual Item numbers.

View Replies !
Kill A Process
I run an Internet TV station, and im using a piece of software on the server to stream content to the shoutcast server. This all works fine. But what is getting at me is the fact that if i want to kill the process so i can broadcast from my local machine i have to log in via ssh and kill them manually.

I already know the php commands to kill a process and also to list the running processes, but i was wondering if it was possible to get the php code to store the PID of the program upon starting so that when the "kill" button is pressed, it reads the string from the database/text file etc. and kills that process only.

View Replies !
Process Form Fields
Hi, I need to process a generic html-form. Is there any way to access to the form elemts as an array?

View Replies !

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