Mod_fcgid: Can't Apply Process Slot For Error?

Mar 9, 2011

update: Just looked at the cache update times of long queries and they did not collide with server crash time. update2: Found the cause of the problem. Ad server is down and the server hangs even though it seemswe set socket timeouts properly. Is there any way to test timeout behaviour?We have a very busy server. ~3K concurrent connectionshe server has 32GB ram 2xCPUs. We have service unavailable error issues.The server does not respond with 500 error and the error log shows hundreds/thousands of lines:

[warn] mod_fcgid: can't apply process slot for /var/www/fcgi-bin.d/php5-default/php-fcgi-wrapper

We think it can be a configuration error or a database connection/query errorA php process updates a cache which is a very very complex query result. 3 separate queries run each twice a day. I have enabled the slow query log. I suspect if the query exceeds the php run time limit 20 secs in our case (set in the following files).

[code]....

ADVERTISEMENT

Can't Apply Process Slot / [Tue May 03 15:44:47 2011] [warn] (104)Connection Reset By Peer: Mod_fcgid: Read Data From Fastcgi Server Error?

May 4, 2011

I've got a problem with a webserver. I did change nothing on the Apache config, I was just working on the site (typo3 FYI) when I got these 500 Error codes. Other websites are running fine. Could it be that it was a one-time error and apache then decided "I dont like you anymore"?

[Tue May 03 15:44:47 2011] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Tue May 03 16:00:02 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/typo3/ajax.php
[Tue May 03 16:00:08 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:00:38 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:00:42 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:01:00 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
and so on...

my fcgid.conf

<IfModule mod_fcgid.c>
MaxProcessCount 100
AddHandler fcgid-script .fcgi
IPCConnectTimeout 20
</IfModule>

would restart the (production-)server solve the problem?

View 2 Replies View Related

Won't Process ELSE Even When IF Doesn't Apply?

Jan 19, 2010

Basically i have a simple login system that just uses sessions, but the code that I have used on certain pages (so that only a logged in member can access the page) doesn't seem to be working properly. Here is the code:

<?php
session_start();
if (isset($_SESSION['myusername'])){
echo ("boo!");
[code].....

View 4 Replies View Related

Connection Reset By Peer: Mod_fcgid?

Aug 16, 2010

When I try to run a program in PHP using domPHP API to create PDF files in runtime - with Godaddy server, I am getting the message - Connection Reset by peer: mod_fcgid

the same work in our local server as well as in Dreamhost and Host gator.

Godaddy support insists that this is a coding error and not server issue.

View 1 Replies View Related

Apache2 - Mod_fcgid With Opcode Caching?

Nov 29, 2010

I have been using apache web server with mpm-worker and mod_fcgid. I have read about mod_fcgid that it can not make use of opcode caching.[URL]....apc cache module seems to be enabled in my php configuration. I am not sure if my spawned php codes are never shared.

View 2 Replies View Related

Apache2 - Sleeping Processes (mod_fcgid) Counsuming RAM Rapidly?

May 30, 2011

We are running a Debian (virtualized) server with Apache running php as fcgi. Today the administrator told me that the processes are consuming the RAM on the system. He asked me to look around my code. Well I think that virtually I have no control over the php processes since Apache spawns them, so this seems more like a server configuration problem. It seems that every request spawns a new php process (this is ok). After my script terminates the php process goes to sleep.

This is what top looks like. I sorted by memory and these are the php processes (they run on the user edem):

top - 14:49:35 up 41 days, 2:09, 2 users, load average: 0.16, 0.13, 0.06
Tasks: 228 total, 1 running, 227 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.7%us, 0.3%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st

[code]...

how to kill those sleeping (idling) php processes? Is there something I'm doing wrong?

View 1 Replies View Related

Slot Booking Mechanism?

May 7, 2010

I am making a doctor appointment slot booking mechanism,where in doctor appointment slots will be divided into 30 mins slot each...i have achieved all the working code.. 1 problem i am facing is that..this booking is made at 2 places i.e 2 receptions..so when 1 selects a slot(radio button) not yet confirmed and saved in DB.

View 1 Replies View Related

Date - Find Next Available Time Slot

Nov 5, 2009

Person A wants an appointment and the available time slots everyday is 9am, 12pm, 4pm, 6pm, 9pm. So, I need to check existing data and compare the time slots booked for the other appointments and then find next available.

$apts = array(
'Person 1' => '1/1/09-9:00',
'Person 2' => '1/1/09-12:00',
'Person 3' => '1/1/09-18:00',
'Person 4' => '1/1/09-21:00'
);

So, I need to find next time slot for Person A against $apts, and it should come up with 4pm (1/1/09-16:00). Then comes along Person B and the next time slot for him/her should be '1/2/09-9:00', since no more time slots on 1/1/09, so go to 9am next day.

View 1 Replies View Related

Make Simple Slot Machine With Realistic Probability

Apr 1, 2010

I was just trying to make a simple php slot machine with realistic probability and was wondering whether anyone would have an idea of how to do that? The slot machine has 3 reels. I've started a function which produces the reels and has the option to select from '7', 'bar', 'orange', 'cherry', 'MISS (spun between 7 and cherry)' and 'MISS (spun between cherry and orange)'. If anyone can direct me on how to weight this probability to make the outcomes such as 7 and bar appear less often

View 3 Replies View Related

Prevent A Time Slot And Seat Number Being Double Booked?

Dec 18, 2010

I have a problem trying to prevent a time slot and seat number being double booked. I am using PHP and MySQL for this. Currently I have no errors concerning variable names or issues with inserting data into the database. The only problem I seem to have involves preventing a certain seat number and time from being double booked. I have tried numerous things and I think the problem lies within my 'if' statement so i have shown a snippet of this below:
   
$sql="SELECT * FROM swinging_ship WHERE Time='$time' AND SeatNumber='$seatnumber'";
$sqlresult=mysql_query($sql) or die("Could not retreive data from table");  
$row=mysql_fetch_array($sqlresult);  
if ($row['Time']=='$time' AND $row['SeatNumber']=='$seatnumber')

[Code]....    

Like I said all my variable names and SQL commands are working and the data is being inserted into the correct database tables and fields. The only problem is preventing the time and seat number from being double booked.

View 1 Replies View Related

Slot Machine - Make The Page Add / Subtract Money Back Accordingly?

Nov 25, 2009

I'm making a harry potter-themed slot machine, and I can't figure out how to get bets to work. I can make the radio buttons...but how do I make a bank of money to have, and how do I make the page add/subtract money from this back accordingly?

<form method="post" action="slotmachine.php">
<p>Place Your Bets!
<input type="radio" name="wager" value="10" /> $10
<input type="radio" name="wager" value="20" /> $20
<input type="radio" name="wager" value="30" /> $30
</p>

View 1 Replies View Related

Error Running Exec() To Kill A Process

Oct 7, 2003

Red Hat Linux 7.3, Apache 1.3, PHP 4.3.3 I am trying to create a PHP script to terminate a process that is running on the server. The file and folder permissions are set correctly, but I am getting the error "kill 943: Operation not permitted"; I am running the command "exec ("/bin/kill 943");".

View 4 Replies View Related

Exec - Catch Background Process Error ?

Aug 30, 2010

How can I catch a background process error in PHP? I am running some commands to convert a PDF but sometimes the process gets killed. Is there anyway to monitor if the process has been completed successful ?

View 3 Replies View Related

Exception Handling - Standardise Error Reporting Process

Aug 31, 2007

I work on a site with a large code base, for which which have our own error handling classes. We've decided to start using php5's exception handling mechanisms but as i look into it, i wonder when this is the right thing to do.

We want to use it to standardise our error reporting process, and to make sure failed bd queries are logged. As i've started though i've realised...

If i throw an exception in the DB class, and make the code using the class responsible for trying and catching, it means we'll have to go through the whole of our site adding try/catch blocks wherever we try and access the db. If we miss one, and at some point throw an exception, we'll get a fatal error which is the worst scenario. Alternatively we could make the DB class responsible for handling the whole situation as follows. Code:

View 3 Replies View Related

Process A Bounce Email To Find The Error Code?

Apr 18, 2011

I've got a mass of 3000+ emails. I need to load up each one into a string (I can do that) and then run them through something, some code or some processing thing that will output the smtp error code of the reason why that email was returned.

Are there any websites that already do this online? Does anyone have an algorithm or some advice I can use to do this?

View 1 Replies View Related

Could Not Start MySQL Service On Local Computer. Error 1067: The Process Terminated Unexpectedly .

Jan 25, 2007

Im getting this problem when i try to start mysql server when i try to right click and select 'start the service'...the lights

still red...i try to went MyComputer>Manage>Services and Applications>Services

i try to start mysql on properties...prompt error came out and says "Could not start MySQL service on local computer. Error 1067: The process terminated unexpectedly" .

View 2 Replies View Related

Create A Script That Will Create A Form Dynamically Then Slot It Into An Html Template

Feb 11, 2010

I am trying to create a script that will create a form dynamically then slot it into an html template where it says {SHOWFORM} the trouble is as with a simple string replace its great for using allready output code however this will call the template find the tag then replace it with the form.Each template will be unique so it will be in a different place each time is there any easy way or shall i just bung it in a function and try the string replace thing?

View 1 Replies View Related

Decide If A Failed System Process Like A Database Query Or Automated Email Merits An Error Message To The User?

Mar 7, 2009

I'm thinking through all the points in my PHP application where it performs some sort of system process like database queries, or sending out an email, and I'm wondering if at all these points I should be notifying a user when something goes wrong. There are so many points where an application can fall apart, that I'm having trouble determining if it is worth it to notify the user. Is it better to have some sort of logging in place, where every few days I just monitor the logs? Is there a standard approach for large-scale applications?

View 3 Replies View Related

Start Process In Background Then Kill Process?

Jan 14, 2010

start a process from php in the background so I can kill it later in the script. Right now, I'm using: shell_exec($Command); The problem with this is it waits for the program to close. I want something that will have the same effect as nohup when I execute the shell command. This will allow me to run the process in the background, so that later in the script it can be closed. I need to close it because this script will run on a regular basis and the program can't be open when this runs. I've thought of generating a .bat file to run the command in the background, but even then, how do I kill the process later?

The code I've seen for linux is:

$PID = shell_exec("nohup $Command > /dev/null & echo $!");
// Later on to kill it
exec("kill -KILL $PID");

View 2 Replies View Related

Multithreading - Process Forking And Get The Child Process Id

Mar 7, 2010

Objective: My script will download a remote file upon form submission, since the file might be big, I would like to fork off a process and let the user go on with his/her life.

Example of a command:

wget -q --limit-rate=1k --tries=10 "http://helios.gsfc.nasa.gov/image_euv_press.jpg" -O /web/assets/content/image/image_euv_press.jpg

Method tried:

pcntl forking,
$pid = pcntl_fork();
if ( $pid == -1 ) {
exit;
} else if ( $pid ) {

[Code]....

Question: the background process method works but it's not clean, is there a better way to fork off a process to download and get that wget command PID so I can kill it later?.

I have tried echoing $! after doing the exec just to get the PID but exec('echo $!') doesnt return anything, i think it's because every exec is a different "space"

I added '> /dev/null 2>/dev/null &' to the end of the command on my terminal it would return something like: [3] 30751, but through php exec, there is no way to capture that returned PID.

View 3 Replies View Related

Unit Testing - Getting The Output Of A Child Process's "PHP Fatal Error"

Mar 25, 2011

I've already learned that you can't catch PHP Fatal Errors, and your script will terminate about as soon as it hits one. I'm running a large PHP test suite (not PHPUnit, but a custom solution) on a CI server, and want to have the test pass/failures to be reported in JUnit output format.

Since way too many things in PHP are "Fatal Errors", I don't want the Fatal Error to end my test run, so my solution was to use forking, something like this:

foreach($tests as $test) {
$pid = pcntl_fork();
if ($pid) {
$test->run();

[Code]....

My idea was to close the STDERR in the child and have it send it's standard error to a pipe that the parent can read and save the error data into the JUnit file, but now I don't know if that's possible. Can you change the file for STDERR? Basically, what I want to do is like popen but without the exec() step.

Can I get the output of a child process after it died of a PHP Fatal Error?

View 2 Replies View Related

Case Statement - Redirect To "index.php?db-backup=error" If The Process Fails

Jun 2, 2009

I've got a function that backs up a MySQL DB but am struggling adding error messages. I've managed to redirect on success, but would like to redirect to "index.php?db-backup=error" if the process fails for some reason.

Code:
<?php
include("config.php");
include("db_open.php");
backup_tables('$dbhost','$dbuser','$dbpass','$dbname');
function backup_tables($dbhost,$dbuser,$dbpass,$dbname,$tables = '*')
{
if($tables == '*')
[Code]....

View 1 Replies View Related

Driver: If KIll A Process Will It Also Kill SQL Server Process (query)?

Nov 27, 2009

I am using PHP SQL Server driver - is there a way to kill the last query sent by sqlsrv_query function?If not, if I kill the PHP process will it also kill the query in turn?

View 1 Replies View Related

Can Apply Css Within Die()

Jul 26, 2010

I need to use my error message div within die()... but i dont know if I can do this.. Im not good with escaping with quatations for example, I got

else
{
die ("Your ip has been blocked. Time till unblock:".($current_time - $blocked_time));
}

I need to put a div in there for the error style:

else
{
die ("<div class='error'>Your ip has been blocked. Time till unblock:".($current_time - $blocked_time));</div>
}

But I know that will just cause a bunch of errors.

View 2 Replies View Related

Apply Preg_match To Get The Value 31.09 Out

Aug 30, 2007

i have somethig like this in my buff:
<TD>Average Rate</TD><TD align="right">31.09</TD>

i want to apply preg_match to get the value 31.09 out..how do it do it?

View 2 Replies View Related

Apply InnoDB

Sep 15, 2007

I had found an application which need InnoDB,I am not sure what is it.However it doesn't support by PHP/MYSQL,I am using xampp as localhost.May somebody help me to work it out?

View 11 Replies View Related

Using PHP To Apply A Class

Jun 20, 2007

I'm struggling to find out how to use php to set a class based on certain criteria. Basically, I'm using a file called navigation.html to store my primary navigation links as a list, and I'm using php's include once to access this in my pages. Obviously this means that I only need to change the navigation once to change it on all pages.

Trouble is I need to highlight the current page so that as users navigate around they know where they are. Is there some way I can use php to apply a class or id to the navigation link that points to the current page?

View 4 Replies View Related

How To Apply Css To Php Table?

Nov 21, 2007

Can you please tell me how to apply css style sheet to php table?

View 3 Replies View Related

Apply Variables From Variable

Apr 12, 2006

i want to apply url string to my page not by from adress bar of browser
(not : http://www.mysite.com/index.php?p=1&r=3&t=1)

i want apply it from one variable that has this url string:

like as:

adressbar: http://www.mysite.com/index.php

PHP Code:

$st="?p=1&r=3&t=1";
// here i must access to $p,$r,$t,...

is there any way to do it?

View 4 Replies View Related

Apply A Function To An Array?

Feb 16, 2010

I am aware of array_walk() and array_map(). However when using the former like so (on an old project) it failed

array_walk($_POST, 'mysql_real_escape_string');

Warning: mysql_real_escape_string() expects parameter 2 to be resource, string given.

So I went with this slightly more ugly version

foreach($_POST as $key => $value) {
$_POST[$key] = mysql_real_escape_string($value);
}

So why didn't the first way work? What is the best way to map values of an array to a function?

View 5 Replies View Related

Apply Similar_text To Array_uintersect?

Jun 18, 2011

I am unsure how to apply my text similarity check function to the array_uintersect function.

Here is my function (Open for ideas on improvement):

function checkSimilar($str1, $str2){
similar_text($str1, $str2, $percent);
if($percent > 75){
return $str2;

[Code]...

View 1 Replies View Related

Apply URL Normalization Rules?

Nov 14, 2010

Is there a pre-existing function or class for URL normalization in PHP? Specifically, following the semantic preserving normalization rules laid out in this wikipedia article on URL normalization, (or whatever 'standard' I should be following).

Converting the scheme and host to lower case
Capitalizing letters in escape sequences
Adding trailing / (to directories, not files)
Removing the default port
Removing dot-segments

Right now, I'm thinking that I'll just use parse_url(), and apply the rules individually, but I'd prefer to avoid reinventing the wheel.

View 1 Replies View Related

How To Apply Htmlentities Selectively

Nov 14, 2010

Whenever display text in an HTML document I always put it through htmlentities for a number of reasons. One of the reasons is that if the text contains HTML, I want the browser to display the HTML code, not render it. The application I am writing requires that I still encode using htmlentities but hyper links need to be left alone. Is there a way to do this efficiently using existing functions or do I need to implement this functionality?

View 2 Replies View Related

Speed Up Ant Apply Over A Set Of Files?

Jun 14, 2011

I'm using the following Ant apply task to run php lint over a set of PHP source files.

<apply executable="php" failonerror="true">
<arg value="-l" />
<filelist refid="server.lib" />
<filelist refid="server.scripts" />
<fileset refid="client.lib" />
<fileset refid="shared.lib" />
</apply>

Based on Ant's output, it takes around 30 seconds.

The same task performed by Make is almost instantaneous.

Is there a way to speed up the ant task?

I've tried adding spawn="true" to the apply section and it sped up dramatically. Aside from the loss of logging, is this a good solution?

spawn=true doesn't play nice with 'failonerror=true' so spawn won't work.

To answer Hakre's question in the comments, the filesets cover 66 files all together.

View 2 Replies View Related

How To Apply Permission Upon Upload

Aug 2, 2007

This code works fine on my server, but when I loaded it onto the production server, all the uploaded files have 600 permissions. How can I modify it so that upon uploading, the files have 777 permissions? Code:

View 11 Replies View Related

Apply Color To B/w Image

May 29, 2007

I have a grayscale image, (just three colors) and I want to use php to apply color to it, so it turns, say, blue. I have a ton of these greyscale images and a lot of colors, so I want to use php to do it when needed instead of doing them all by hand in photoshop. I have done some searching but I'm not even sure what to call this.

View 2 Replies View Related

Apply Trim On Whole Array?

May 9, 2011

Is there a way to apply the function trim() on a whole array, instead of applying it to the individual input fields one by one?

Here's the code:

$blurb1_title = array ( 
$_POST['blurb1_title1'], 
$_POST['blurb1_title2'],

[code]....

All those $_POST variables are input fields, and I would like to apply trim() to them so the spaces get removed. Is there an efficient way to do it without having to apply it all individually, if yes, what would be the correct syntax?

View 5 Replies View Related

Apply More Than One Function To A Variable?

Jan 7, 2010

I am validating a form and want to apply several methods to each one of the five fields in a form.

View 10 Replies View Related

Apply Strip Tags To A File?

Apr 20, 2007

Can I use strip_tags on a file and return the result in another variable? How would I do something like that?

View 3 Replies View Related

Apply Some Sort Of Encryption/security

Dec 18, 2005

I made a "members" script for my site, where poeple have the choice to register to be part of the community... its in PHP, and someone emailed me saying that they could easily hack into the members page --

they could view all the passwords log into the admin page, and what not... I was wondering if there's a way I could apply some sort of encryption/security so that I could prevent this.

The person that did it, gave me a hint - saying it was something easy that I could do to prevent this... but wont tell me exactly what. I was thinking somewhere along the lines of CHMOD-ing the files to 666 or 755 or something.. but I dont think that's quite it.

View 2 Replies View Related

Apply The Rules In A CSS File To A Certain Div / Class?

Sep 16, 2009

I want to apply the rules in a CSS file to a certain div/class so, for example, the contents of events.css is only applied to the contents of a class called .events and not outside this scope without the need to add the class .events to the start of each css rule.

I am thinking this is not possible though - but you never know.

If not I am thinking of achieving the same effect by prefixing the .events to the CSS rules after they have been uploaded/edited.

View 4 Replies View Related

Apply Css For The Data Fetched From The Database?

Mar 4, 2010

I am fetching the datas from the database...And the datas are displayed as dropdownmenu but the css is not applied

<ul id="nav">
<?php
$res=mysql_query("SELECT * FROM menu WHERE PARENT_ID=0");
while($row=mysql_fetch_array($res))
{

[Code].....

View 1 Replies View Related

Java - How To Apply Static Class

Nov 15, 2010

In java i can use static class/method so that anyone can use the same one time created class during run-time.

But for php how to do it since it is script based and only run while we refreshing the page?

My main objective is, I want to use syncronized class/method so that it wont clash while executing the PHP...

Update:

I am doing portal like multi level marketing(mlm) Once register a member, we should pay bonus to the uplines I don't want immidiately calculate the bonus because it is risky and could take some time to finish, so is is better just to register the member and show successfull. My idea is, after registration, just invoke another class to run bonus with syncronized method so that the bonus calculation will not disturb by another registration.

View 2 Replies View Related

Apply The MVC Design Pattern To Procedural?

Feb 1, 2011

I've been trying to find out if I can apply the MVC architecture to procedural and how I can go about implementing this into my code. From my understanding MVC basically represents the separation of the business logic, presentational layer and other logic although it always seems to be aimed at OO-PHP in particular. Can you recommend the best way to approach MVC within a procedural context?

View 4 Replies View Related

Apply Backticks To First Word In Sentence?

Jan 14, 2011

basically what I am trying to do is,

I have an array that looks something like this:

array(
array(
'select' =>'first string',
'escape' => true
),

[Code]....

but the $item['select'] = line seems rather long winded, is there a better way to write it?

View 4 Replies View Related

ADVERTISEMENT