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 Complete Forum Thread with Replies
Related Forum Messages:
Listing Date - Creating Permanent Listing?
I have a script that has a drop-down for how long the listing will be published. Right now, it uses the following to decide between 2 weeks, 1 month, 3 months, or 6 months: $cadate = time(); if ($gueltig == ཊ')$caend = $cadate + 1209600; elseif ($gueltig == ཚ')$caend = $cadate + 2592000; elseif ($gueltig == ྖ')$caend = $cadate + 7776000; elseif ($gueltig == 餎')$caend = $cadate + 15724800; else$caend = $cadate + 1209600; $deltime = strftime(""._CLADS_STRF."",$caend); I know this is a stab in the dark, and without seeing the rest of the code, is there another elseif I can add so that the listing will be there permanently?
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 !
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 !
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 !
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 !
Listing
i wanna make a script that lists a user defined about of images per page. i think i can use arrays for all this, but im not really sure = so what i need to know is, do i need a database??
View Replies !
IF Listing
Is it possible to check multiple variables in an IF statement at once? Like instead of doing: if($this == NULL || $that == NULL || $thing == NULL) todo something like if($this, $that, $thing == NULL)
View Replies !
Next Listing?
I am working on a real estate listing website. What I am trying to do is create a link on each listing's page that will go to the next listing. This would be easy if it was just the next listing, but I'm trying to make it go to the next listing that the user got in their search. How would I go about doing this???
View Replies !
PHP Dir Listing
Can PHP provide a directory listing of local files? I need a list of filenames within a directory, including it's subdirectories, on Windows XP. Most filenames include characters outside the standard western set. Windows filenames are apparently UTF16 and, on English XP, the DOS command dir /b /s *.* >filelist.txt seems to work only for ~ASCII so I end up with '?' marks for each character outside this. I've tried Xenu but it didn't pick them up as orphan files. This following a post to the Microsoft Windows OS forum.
View Replies !
Listing/sorting
I want to print out only if the site is in the database. this works for the links, however, if the there is no site under that letter I still have the output of the letter. if I do it under the second example I have a letter for each link. How can I do this? Code:
View Replies !
Listing All Variables
Does anyone know if it is possible to list all variables that are in a script? I'm working on a project where I'm creating several sets of dynamic (variable) variables and I'm starting to get lost in my code. Any suggestions?
View Replies !
Listing By Date.
I have a problem, i'm doing a tour date script for a band and sometimes they get dates mixed up because the order they confirm them on, so they might input 'April 24, 2001' then 'April 20, 2001' days later which causes the problem of having the dates mixed up when calling them from the db, is there a way to list the dates in order since there is no timestamp?
View Replies !
Directory Listing ...
I'm a newbie to PHP and need to be able to get a list of the files/sub-directories from a particular directory on the server (ie: I want to load the list of files in the program's current directory into an array). This must be possible but somehow I can't find the syntax in my documentation. Can someone send me a snippet of syntax? Or point me towards a good 'howto' that maybe has a catalogue of PHP commands?
View Replies !
Directory(ONLY) Listing
How to make a directory listing with php using Directory Function. I dont want to list all files inside the directory but just the list of the subdirectory/subfolder inside.
View Replies !
Alphabetical Listing
I've been trying and can't get it. I would like the results to come out in alphabetical order according to the parasitename. Here is without me trying: Code:
View Replies !
Directory Listing
I recently wrote an upload script, and along with it when you uploaded it a directory listing script shows the files in the uploaded folder. Code:
View Replies !
Need To Add <tr> To Array Listing
The code below allows me to show the logos for all partners listed in our database. However, it shows the logos all on one long row when they appear on the page. I can add a <tr> within the loop but then just get one logo per row. How do I make it show only 3 logos in each row until it has shown all partner logos in the db? Code:
View Replies !
Listing Tables
I want to list a few tables from my database, but only the ones containing the word "round*" as a tablename. So far I have this, and this will give all the tables in database. How do I build in this query? $result = mysql_list_tables($database); $num_rows = mysql_num_rows($result); for ($i = 0; $i < $num_rows; $i++) { echo "Table: ",mysql_tablename($result, $i), "<br>"; } ...
View Replies !
Listing Photos
I am developing an image bank i allready have the database built and a layout test for showing the photos and categorys. My problem is that all the pictures they show one under other and what i want to do is list the photos in 3 rows and 4 columns. My following code that i am using is: $sql = "select * from $table where categoria='$maingroup' "; while($row = mysql_fetch_row($sql)) { printf("<img src='%s' width=ï‘' align='center' border=0>",$resultado["foto"]); }
View Replies !
Php Listing A Directory?
is there a way in php to list a directory on the remote server...etc. i have 4 files blah.txt test.html fred.jpg and mel.doc I want to search the given directory for *.html / htm files. then return them... ie i want to create a <select> option and value for each .html found.
View Replies !
Listing Script
the script below works so that it lists the users files in their folder but I was wondering if it would be possible for someone to comment on what everything does in the script so that i can add a feature that says that there are no files in the users folder if none are present or could some one jsut show me how to do this <?php include "../status.php"; $cookie_info = explode("-", $_COOKIE['cookie_info']); $namecookie = $cookie_info[0]; $files = array(); $dir=opendir("./$namecookie"); while(($file = readdir($dir)) !== false) { if($file !== '.' && $file !== '..' && !is_dir($file)) { $files[] = $file; } ..........................
View Replies !
Listing Page
i have been using mysql and php for a little while now but i have no idea how to do this. i have a mysql database with a list of names, lets say 100 names and i need a page to display the first 10 names organised by a certian field and at the bottom have page numbers to display the rest of the names, you know 1...10.
View Replies !
Dir Listing Isn't Alphabetical
For some reason unbeknownst to me, when I do a directory listing on one of my sites, it lists them not alphabetically, but chronologically (by creation). Can anyone tell me how to fix this? $maindir = 'mp3/' if ($handle = opendir($maindir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $name=str_replace('-'," ",$file); $name=str_replace('_',": ",$name); $name=str_replace('.mp3',"",$name); echo ' <li><a href="mp3/' . $file . '">' . $name . '</a></li>' . chr(13) . chr(10); } } closedir($handle); }
View Replies !
Listing Filenames
I am wondering if anyone can help with some code that would get a list of filenames and pass them as <src img="locationfilename">. Basically what i am trying to do is get a list of file names (all jpg's) and display them on the page.
View Replies !
Listing Thing!!
How do i make a listing which in my case will list bands dynamicly. so like a A list will be listed from a text file preferably not a SQLserver. but also so that it can be formated and will create table cells for each band name which also has to be made a link....
View Replies !
TimeclockTimeperiod Listing
I' creating a timecard, and I am at the point where I am coding the reports. So what I am trying to set up is for a list of all the payperiods Employee X has worked. For example: Each payperiod begins on Friday and ends on Thurday. So: Employee X starts working on May 18 (a Thursday) and is still working in the present, so in theory the script would print the report like this: 05/12/06 - 05/18/06 05/19/06 - 05/25/06 05/26/06 - 06/01/06 06/02/06 - 06/08/06 Where every payperiod that has AT LEAST one day worked is displayed. (starts displaying upon first day of work and stops displaying when it reaches the current time. - ie: doesn't show every payperiod for ག right off the bat) The idea behind it of course is to lead to being able to click into a certain payperiod and see the individual days worked in order to make edits and so forth.
View Replies !
Listing Info In Row Once
I have multiple rows for the same "id", but when I come to display it in a table, it loops the 'id' rows 2 or 3 times, what I want to do is loop each "id" once, so: id:|obja:|objb: 1 | 1/2 | 12/15 2 | 5/6 | 20/30 Instead of: id:|obja:|objb: 1 | 1 | 12 1 | 2 | 15 2 | 5 | 20 2 | 6 | 30 ...
View Replies !
Get A Directory Listing By ID
Here is how I am uploading the files. PHP Code: $ID = mysql_insert_id(); //get the id of the last to append to the beginning of the filenames $filename1 = "/path to directory/staff/uploads/" . $ID . "-" . $FILE1_name ; $filename2 = "/path to directory/staff/uploads/" . $ID . "-" . $FILE2_name ; @copy("$FILE1" , $filename1); @copy("$FILE2" , $filename2); ......
View Replies !
Listing *some* Files
I am using the following code to pull a list of all files in a directory: Code: <? if ($handle = opendir('directory_here/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo $file . "<br>"; } } } closedir($handle.
View Replies !
How Do You Delete A File From A Listing Please?
I have the code: <?php if ($dir = @opendir("../project/proj_images")) { while (($file = readdir($dir)) !== false) if($file != ".." && $file != ".") echo "<tr><td align="left" class="bodyblue2">$file</td></tr>"; closedir($dir); } ?> which displays a list of files in a directory. What I want, is to be able to click on a file in the list and delete it. I know you use unlink but how do you tie it in with the above code?
View Replies !
Listing Images From A Given Directory
I wish to list images (even thumbnails if possible) on a html site. The images should be placed in a given directory (URL). How do I get the list of images and perhaps even the list of directories? And secondary, but not so important - how do I display thumpnails of the images - e.g. resizing images.
View Replies !
Looking For Book Listing Script
I am in search of a simple book listing script (school textbooks for example) - (PHP/MySQL). The only thing I really need is a simple script that will allow me to add or modify custom fields to the submission form.
View Replies !
Directory Listing With Array
I need to wiev in a php page the listing of one on my directory in the webserver. can someone help me to understand how? for every file in thw directory I need a row in a html file.. directory: /opt/dir result: file1 file2 file3 ...
View Replies !
File Listing Error!
I've been having trouble with my php code lately, first when i tried to make it so noone could leech files with some .htaccess stuff i got 500 internal server error's, when i removed it [.htaccess] my script stopped working completely, can you please check the code and see what i did wrong (note: this script is supposed to display all the files in the directory. Using a Include) PHP Code:
View Replies !
|