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 Complete Forum Thread with Replies
Related Forum Messages:
Problem In Handling Long Text In MYSQL Table
i am making a database driven website which is working fine. My web page contains lot of text and it is very diffcult to upadate its content from the text_field of MQSQL table. As i have to read each line again and again to update it. I have alloted parent_id to each category_id in my database table and thus retreving results from it... I want to know what should i do to handle this long text ...such as if i am able to make a seperate text file for each of my html_body variable and somehow include that file to a webpage when i select a particular parent_id from my wepage.
View Replies !
How Long Is Too Long For A Script To Execute? GetTimer()
I'm using some scripts and they're executing from .007 - .010 It defines many files, imports several files (total of maybe 20), encrypts 2 strings several times base64 IN flash, WWW-Authenticating to a PHP file, PHP grabs a MySQL Query, returns it, traces it. That happens all in .007 seconds roughly. How long is too long until you should find a new script. If a script runs with a time of .05, is that the general limit or is that fast?
View Replies !
Strtotime And Dates Long Long Ago ...
while making an encyclopdie on my hometown (dutch, http://www.kgv.nl/index.php?id=610) i am trying to use dates prior to 1970. birthdates in, let's say, 1615. i'm getting errors while working with these dates, for example when i am calculating which day of the week it is. the dates are stored in a mysql database. is there another way to convert stringtype dates to work with?
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 !
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 !
How Long Is Too Long For A Cgi Script?
I have a 4000 line php cgi script that is not memory or cpu intensive. It runs in 1 second. Now I am getting a lot of customer requests to add in new features. My question is if there is a point where my code will be too long and take too long to run (i.e > 5 seconds). I would really like to have my script rival the functionality of a desktop application but can php do it? My server is a dual processor with 2GB ram.
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 !
Login Script That Checks Long Long It Has Been Since A Last Login
i need to make a login script that checks long long it has been since a last login. I have Mysql so i can use that to store the last login date. Can someone help me figure out how to find how many days ahve passed since a previous login. Like what format should the last loin date be stored in. Also how i get it to figure out how many days have passed since the last login.
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 !
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 !
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 !
How Long For A Session?
how long a session lasts for. It's been a long time but I thought it was 20 minutes by default. IS this correct or is it some other time? Assuming the browser is not closed of course.
View Replies !
Long Text
im trying to figure out how to format text in a database ... If I have a TEXT AREA in a form .. and an user inputs say like 5 paragraphs ... how can I have it to where mysql will display that as 5 paragraphs and not just i chunk of text when i display it at a later date ?
View Replies !
Long Insert
I need to update a table in mysql and the information is very long. I changed it to Longtext and whenever i use php to update it, the query returns true but the data never gets inserted into the database. Here is an example of the text that would be entered: Code:
View Replies !
Long String
I have made a forum, it is working fine. Came accross a new problem today, someone posted a long website address, and the table that the text is written in stretched to fit it, making the page much wider than it should be. How can I make sure that long web addresses or wordswithoutspaces will not ruin the aesthetics of the forum?
View Replies !
One Long Line?
I was wondering, when I view my source in the browser my PHP code shows as one long line. Any ideas why this is?
View Replies !
Long Decimal
I am using PHP 4.3.3 I am developing a site about astronomy the needs high precision calculation (that will use numbers of 20 decimal points). I've increased the precision value in php.ini to 25, but PHP seems to accept only 15 decimal points.
View Replies !
Oracle + PHP + Long Process
Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB on a separate Linux box. I need to create a PHP web interface to allow an end-user to run a PL/SQL stored proc that will do a force refresh of a series of materialized views following the loading (through another PHP interface) of additional flat file data into the underlying tables. I want to allow multiple data uploads and then do a single refresh, so I won't be able to use fast refresh or other internal database trigger mechanisms. My real problem is that the time taken to execute the stored proc is likely to considerably exceed the max script execution time for PHP, and I don't want the end-user interface to just sit there bubbling away waiting for the Oracle processes to return a response anyway. I am considering creating a "master" PL/SQL stored procedure which would use the Oracle DBMS_SCHEDULER package to run a nearly-immediate job as a "background" (to the PHP interface) process. Is this the way to go, or are there other better solutions that I am overlooking?
View Replies !
How Long Can I Make A Cookie Last?
I realize that the "cookie" is not a PHP-specific topic. However, I'm developing my web site using primarily the PHP programming language so I thought that the PHP forum would be an appropriate place to post this question. My question is this: Is there a limit on the amount of time that a cookie will remain on a user's computer? In other words, if I code a time frame of a year or two for the cookie to expire will the cookie stay on the user's computer for that long?
View Replies !
Condensing Long Strings
Say I have a really long URL e.g. http://www.testing123.com/testing123/testing123/testing123/testing123/testing123.html What I want PHP to do is to condense it in a way that most popular forum software does. So the resulting URL should look like http://www.testing123.com/testing12...testing123.html I'm guessing regular expressions would do something like this, but I don't have a clue at how to accomplish this.
View Replies !
How Long To Session Vars Last?
How long do session vars last? I believe some of my applicants are taking a long amount of time to complete their app, which is creating problems. Is there a way to lengthen the time that a session var is available? I would also like to do this to allow admin/csr's to stay logged in longer without having to log back in.
View Replies !
Session_start Costed Too Long....
I used ajax. When the first time I visit the page, it spent about less than 0.3s but when I visit the same url second time, it cost more than 10s, I located the session_start(); call ,what is the problem?
View Replies !
How Long Does It Take For A Session To Timeout
How long does it take for a session to timeout,if I have a user logged in on my site, how much time of inactivity will it take before the session is automatically destroyed and they become logged out,i do not use cookies,I have these values in my php info session.cache_expire 180 session.gc_maxlifetime 1440 session.gc_probability 1 from what I understand the session is destroyed after 180 minutes of inactivity,but the session has a 1% chance of being garbage collected after 1440 seconds of inactivity (is this destroyed?) so if I wanted all sessions destroyed after the 1440 seconds, should i set the probability to 100 or should i change the session.cache_expire 180 to something that would suit me better, i.e. the 1440 seconds, i.e. session.cache_expire 24, would this always delete the session after 24 minutes,or do both values have to correspond etc,
View Replies !
Foreach On A Long Array
My array: $pos_array = array( 0 => array("p1_pts" => $pts_1, "user_id" => "$p1_id", "pos" => 0), 1 => array("p2_pts" => $pts_2, "user_id" => "$p2_id", "pos" => 1), 2 => array("p3_pts" => $pts_3, "user_id" => "$p3_id", "pos" => 2)); How would I do a Foreach on a long array like this? I know the basic ($pos_array as $x => $y) but not anything bigger.
View Replies !
Convert Double Value To Long Value
I have this issue with doubles values. When I store a long value like 1234567898999, the data is stored like 123E+10 or something like this. I need retrieve the data like long value, like 1234567898999, but I need store it like double value.
View Replies !
Displaying Long Text
I have a MSSQL 2000 database with survey data, the data field that contains the long data is varchar (8000). When I display the data it truncates the data to 255 characters including spaces. The following code is something like this: while($Results=mssql_fetch_array($SQL_Query) { echo $Results[0]."<br />"; } Is there something that I am missing?
View Replies !
How To Handle Long Process
i am developing a php web application where some programs requires a long time to process, such as going through a large table in a database and updating fields in each record. how can i do this without causing a page to timeout?
View Replies !
Shorten A Long String To .
I'm outputting a large amount of data from mysql and I want to shorten it. I want to change this display "Once upon a midnight dreary, while I pondered weak and weary. " to something like this "Once upon a midnight ..." Any ideas guys? I bet I'll get a fix in 10 minutes.
View Replies !
Replacing Too Long Stringswith
I have: echo $item; and it puts out a string. the problem is it should check if the string is not longer than 40 characters, and if it is it should cut it at 40 and then replace it with "..." any tips how to do this?
View Replies !
Long Encrypted String
When I login the hotmail, I got a 64 character long string as part of the URL and it changes each time I login. Also when I login in Yahoo email, there is a 13 character long random string generated. Can someone tell me what purpose they serve? I am just wondering if it's better if I change the all the user IDs in my system from auto_increment to a encrypted 32 or 64 long string.
View Replies !
Shorten Long IF Statements
Is there a way to shorten long IF statements like below: PHP Code: if($searchPhoto != "I" and $searchPhoto != "Y" and $searchPhoto != "N"){ $do_searchPhoto = ""; }
View Replies !
Truncate & Tag Long URLs?
I'm looking for a way to truncate/ add-spaces & tag long URLs, so that "Check this out http://www.example.com/hello-world/foo-bar.html it's great" would turn into: "Check this out <a href="http://www.example.com/hello-world/foo-bar.html">http://www.exampl e.com/hello-world/fo...</a> it's great" or "Check this out <a href="http://www.example.com/hello-world/foo-bar.html">http:// www.example.com/ hello-world/ foo-bar.html</a> it's great" This is because my discussion forums width is restricted and long URLs break this. Code:
View Replies !
Long Text Input
I need to add a field to an existing table. The input will be a few paragraps of text. Shall I be using LONGTEXT or BLOB? And what's the difference between the two?
View Replies !
How To Hide Long Url Address?
I just wish to know how to hide long url address ie., http://localhost/braough/sub/list?a&bak?b&cad?mad into just http://localhost, so the user won't see the subdirectories or long path in the url address.
View Replies !
Long Query, Need To Break..
I am going to have a long mysql query and would like to break the line so I can read it better. I have tried combinations of quotes, single quotes, and peiods to join the line breaks but with no luck. Code:
View Replies !
|