php-general Digest 6 Jun 2009 14:19:41 -0000 Issue 6161
Topics (messages 293667 through 293685):
Re: formatting - design question
293667 by: tedd
293668 by: Ford, Mike
293679 by: PJ
Perplexing problem.
293669 by: Gary
293670 by: Daniel Brown
293671 by: Gary
293672 by: Gary
293673 by: Daniel Brown
Re: Google Calendar Integration
293674 by: Tom Chubb
293685 by: kranthi
Re: PHP Graphing Libraries...?
293675 by: tedd
293676 by: Richard Heyes
293681 by: cr.vegelin.gmail.com
Re: https setup
293677 by: PJ
293678 by: PJ
293680 by: PJ
Outputting File To The Browser Failed And Kill Apache
293682 by: Nitsan Bin-Nun
293683 by: Nitsan Bin-Nun
293684 by: Tom Worster
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
At 10:23 AM +0100 6/5/09, Peter Ford wrote:
PJ wrote:
> tedd wrote:
>> First you figure out a layout, then you populate it. You don't pick a
>> layout, populate it and then change the layout.
>>
If only it were that simple.
When one is developing, one is always changing. And even when you're
finally "live and on the air", you will still be changing or else your
site will die before your client gets a chance to see all you can offer.
It's a matter of evolution and adaptation, Darwin. ;-)
Agree with PJ here:
More likely, you go live and the boss says "Can you make that look
more like ...?"
"Er, yes, but it totally stuffs the whole design..."
If your Boss wants you to "test out" designs for his approval, that's
one thing. I see no problem with a "Let's see what this might look
like?" initial design decisions -- after all, he's paying for your
time.
However, IMO his buck would be better spent if he hired a designer to
design something around the needs of the project. I understand that
sometimes "Bosses" aren't the brightest lot when it comes to things
outside of their job description. But it is also your charge to
explain the change asked for "totally stuffs the whole design..." If
your Boss doesn't care about cost overruns in development, then start
studying for his position because his boss does.
I am addressing what to do with clients who change their minds on
agreed layouts.
My practice is the client decides on a layout that fits their needs
before any development is done. If the client wants to change their
mind in the middle of the development stage, that's fine -- but they
will also pay for that change.
In my book, the "best" way to design a site is to: 1) decide what
functionality is needed; 2) and then design a layout that presents
the functionality in an attractive and accessible manner.
Creating a site is a lot like programming. The time spent identifying
the problem will: a) shorten the overall time required to create a
solution; b) and will also provide a more stable solution.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On 04 June 2009 19:09, PJ advised:
> Nitsan Bin-Nun wrote:
>>> From my experience I tend to use a difference ID for the
> body tag, for
>> instance <body id='homepage'> and then format it in my CSS using ID
>> reference: #homepage .classname {
>> color: blue;
>> }
>>
>> This way you can use a default format for all the pages and create
minor
>> (or major) changes in the theme in no time :)
>>
>> I would also suggest to attach the CSS filename reference at the
<head>
>> tag the update time of the file, so that the browser will
automatically
>> update the cache of the CSS whenever you decide to edit it.
>>
>> Just my 2 cents ;)
>>
> Oh, I think it's worth a lot more than that.
> I just installed IE 8 just to have it for verification. It's no better
> than IE 6. I never use them personally.
> But how do you produce interesting web pages to look well on both
> without making stupid compromises. What looks well on Firefox, looks
like
> MSshit on IE.
This may be a silly question, but reading this just makes me wonder --
you do have an appropriate <!DOCTYPE as the very first line of your HTML
to prevent IE going into Quirks Mode?
I don't usually have *that* much trouble getting IE to render very
similarly to Firefox (and IE8 is reportedly much better), but if IE is
in Quirks Mode it makes a huge difference and presents all sorts of
rendering problems. (The Firefox Web Developer plugin will tell you if a
page is rendering in Quirks Mode or Standards Compliance Mode.)
Cheers!
Mike
--
Mike Ford, Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus,
Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom
Email: [email protected]
Tel: +44 113 812 4730
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--- End Message ---
--- Begin Message ---
Peter Ford wrote:
> PJ wrote:
>
>> tedd wrote:
>>
>>> At 3:58 PM -0400 6/4/09, PJ wrote:
>>>
>>>> tedd wrote:
>>>>
>>>> > Style sheets are meant simplify things so decide on how you want
>>>>
>>>>> things to look uniformly throughout your site and then stick with it.
>>>>> There's really no good reason to keep changing things throughout a
>>>>> site.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> tedd
>>>>>
>>>>>
>>>>>
>>>> Maybe I'm just too complicated. ;-)
>>>> I do try to keep it simple. But then, little things creep in, like a
>>>> login box on the index page which mucks up all the other pages. Then
>>>> there is a recipe page which is totally different, yet to keep is
>>>> stylistically continuous it uses a similar layout to the other pages but
>>>> different. The same for the main recipe page, and the same for the
>>>> portraits of producers - all the pages are different yet remain within a
>>>> cohesive style. CSS gets super bloated and almost unamageable. Most
>>>> sites are very repetitive; mine tend to be "provocative" or semthing
>>>> like that. I really don't see an ooption. Although, Nitsan's body tags
>>>> sound promising. I'll have to try that; maybe the solution is to do a
>>>> series of definitions unique just fo certain pages. :-)
>>>>
>>> That's simply an example of not thinking things out before you write
>>> the code.
>>>
>>> First you figure out a layout, then you populate it. You don't pick a
>>> layout, populate it and then change the layout. That leads to a
>>> lackluster and "lack of thought" site.
>>>
>>> Cheers,
>>>
>>> tedd
>>>
>>>
>>>
>> If only it were that simple.
>> When one is developing, one is always changing. And even when you're
>> finally "live and on the air", you will still be changing or else your
>> site will die before your client gets a chance to see all you can offer.
>> It's a matter of evolution and adaptation, Darwin. ;-)
>>
>>
>
> Agree with PJ here:
> More likely, you go live and the boss says "Can you make that look more like
> ...?"
> "Er, yes, but it totally stuffs the whole design..."
>
> Evolution was *not* carefully thought out - that would be Intelligent Design
> <spit/>
>
Chuckle, chuckle. ;-)
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
I have a form script that is not cooperating. When I fill out this form, I
get the checkbox "yes", but not the checkbox "info" Also, in the message on
the result page that displays, I get "Yes, send me referral Caaaaaards! at
the bottom. ( I have spelled card as Ccccccard and Caaaaaard to see where
they are coming from).
So if(isset) for the info is not working, but the if(isset) for the yes is.
I have switched positions but no change.
The link to try this is http://www.paulgdesigns.com/elk/referform.inc.php
Can anyone see what I am missing here?
Thanks.
Gary
<?php
$fname=STRIPSLASHES($_POST['fname']);
$lname=STRIPSLASHES($_POST['lname']);
$title=STRIPSLASHES($_POST['title']);
$company=STRIPSLASHES($_POST['company']);
$street=STRIPSLASHES($_POST['street']);
$town=STRIPSLASHES($_POST['town']);
$zip=STRIPSLASHES($_POST['zip']);
$phone=STRIPSLASHES($_POST['phone']);
$fax=STRIPSLASHES($_POST['fax']);
$county=STRIPSLASHES($_POST['county']);
$phone=STRIPSLASHES($_POST['phone']);
$email=STRIPSLASHES($_POST['email']);
$comments=STRIPSLASHES($_POST['comments']);
$date=STRIPSLASHES($_POST['date']);
$time=STRIPSLASHES($_POST['time']);
$location=STRIPSLASHES($_POST['location']);
echo "Thank you $fname for your submission!<br /><br />";
echo "You have submitted the following information.<br /><br />";
echo "Name: $fname $lname<br />";
echo "Title: $title<br />";
echo "Company: $company<br />";
echo "Address: $street $town $zip<br />";
echo "Zip: $zip<br />";
echo "Phone Number: $phone<br />";
echo "Fax Number: $fax<br />";
echo "E-Mail Address: $email<br />";
if (isset($_POST['info']))
{
echo "Yes, send me information on your referral program!<br /><br />";
}
if (isset($_POST['yes']))
{
echo "Yes, send me referral Cccccards!<br /><br />";
}
echo "$fname, we have also sent you an e-mail to $email with the submitted
information as well as our contact information for your convienience. Thank
you for the opportunity to serve you!";
// checks if bot
if ($_POST['address'] != '' ){
die("Changed field");
}
/*This is the email message to submitter*/
$contact="sanitized";
$from_d="$email";
$to_d="$email";
$subject_d='Thank you from ;
$msg_d="Thank you $fname for your submission, find our contact information
listed for your convenience.\n\n"
."$contact\n\n"
. "You have submitted the following information\n\n"
. "Name: $fname $lname \n"
. "Street Address: $street\n"
. "Town: $town\n"
. "Zip Code: $zip\n"
. "Phone Number: $phone\n"
. "E-Mail Address: $email\n"
. "Yes, Send me referral Cards\n"
. "Yes, Send me infomation on your referral program\n"
;
mail($to_d, $subject_d, $msg_d, 'From:' . $from_d);
/*this is to elk, y*/
$from="$email";
$to="xxx.xxxx.com";
$subject="Submission from Referral Form";
$msg= "This is a submission from elkenv.com. Please send referral
cards.\n\n"
. "Clients Name: $fname . $lname \n"
. "Title: $title\n"
. "Company Name: $company\n"
. "Street Address: $street\n"
. "Town:$town\n"
. "Zip: $zip\n"
. "Telephone: $phone\n"
. "Email Address: $email\n"
;
if (isset($_POST['info']))
{
echo "Yes, send me information on your referral program!<br />";
}
if (isset($_POST['yes']))
{
echo "Yes, send me referral Caaaaaards!<br />";
}
mail($to, $subject, $msg, 'From:' .$from);
?>
--- End Message ---
--- Begin Message ---
On Fri, Jun 5, 2009 at 11:28, Gary<[email protected]> wrote:
> I have a form script that is not cooperating. When I fill out this form, I
> get the checkbox "yes", but not the checkbox "info" Also, in the message on
> the result page that displays, I get "Yes, send me referral Caaaaaards! at
> the bottom. ( I have spelled card as Ccccccard and Caaaaaard to see where
> they are coming from).
[snip!]
I got both confirmations on the page, Gary, but in the second echo
block.... do you mean to append it to $msg instead? Having it echo
out will display it, not add it to the email.
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000
--- End Message ---
--- Begin Message ---
Unbeleieable.... I am now getting it correct on Chrome, but not FF...I have
been wracking my brain and it was firefox....
I dont get it...
"Daniel Brown" <[email protected]> wrote in message
news:[email protected]...
On Fri, Jun 5, 2009 at 11:28, Gary<[email protected]> wrote:
> I have a form script that is not cooperating. When I fill out this form, I
> get the checkbox "yes", but not the checkbox "info" Also, in the message
> on
> the result page that displays, I get "Yes, send me referral Caaaaaards! at
> the bottom. ( I have spelled card as Ccccccard and Caaaaaard to see where
> they are coming from).
[snip!]
I got both confirmations on the page, Gary, but in the second echo
block.... do you mean to append it to $msg instead? Having it echo
out will display it, not add it to the email.
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000
--- End Message ---
--- Begin Message ---
As usual, thank you for your help. How do I get it to display in the emails
only if the boxes are checked?
Thanks again.
Gary
"Daniel Brown" <[email protected]> wrote in message
news:[email protected]...
On Fri, Jun 5, 2009 at 11:28, Gary<[email protected]> wrote:
> I have a form script that is not cooperating. When I fill out this form, I
> get the checkbox "yes", but not the checkbox "info" Also, in the message
> on
> the result page that displays, I get "Yes, send me referral Caaaaaards! at
> the bottom. ( I have spelled card as Ccccccard and Caaaaaard to see where
> they are coming from).
[snip!]
I got both confirmations on the page, Gary, but in the second echo
block.... do you mean to append it to $msg instead? Having it echo
out will display it, not add it to the email.
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000
--- End Message ---
--- Begin Message ---
On Fri, Jun 5, 2009 at 11:50, Gary<[email protected]> wrote:
> As usual, thank you for your help. How do I get it to display in the emails
> only if the boxes are checked?
<?php
// ....
$msg .= isset($_POST['info']) ? "Please send info.\n" : "Do not
send info.\n";
// ....
?>
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000
--- End Message ---
--- Begin Message ---
2009/6/5 Leonard Burton <[email protected]>
> HI All,
>
> Has anyone used Google Calendar (of course via PHP) to allow clients
> to schedule appointments from the business's webpage? If so, would
> you please tell me how you made it so it would only show the client
> times which were available and of course not listing private client
> details?
>
> Thanks,
>
> --
> Leonard Burton, N9URK
> http://www.jiffyslides.com
> [email protected]
> [email protected]
>
> "The prolonged evacuation would have dramatically affected the
> survivability of the occupants."
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Haven't done this yet, but this this link should help:
http://framework.zend.com/download/gdata Apparently you don't have to use
the whole Zend framework for it.
HTH
--- End Message ---
--- Begin Message ---
and you have a complete set of documentation at
http://code.google.com/apis/calendar/
--- End Message ---
--- Begin Message ---
At 4:33 PM -0400 6/4/09, [email protected] wrote:
Hi All,
I'm currently looking for a quality (preferably open source) PHP
graphing library that will allow me to create various graphs and
plot points. I've seen several that do some amazing things, but
cost a fortune -- others are either limited, lack documentation, or
don't allow plotting of points for multiple entities within the same
graph.
Can anyone make any quality suggestions?
Best,
Michael
Michael:
All sorts of stuff out there -- check out GDGraph
Here's an example:
http://webbytedd.com/ccc/charts/
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Hi,
> I've looked at the docs and I don't see how exactly it handles "x,y"
> plotting. I need the ability to plot multiple lines (which it obviously
> does) with wildly varying "x,y" values. It seems that all of these
> libraries "cheat" and force common "x" values via the labels. I need
> something like the following (all in the same chart):
> $line_one_data = [x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y,x,y]
> $line_two_data = [x,y,x,y,x,y,x,y]
> $line_three_data = [x,y,x,y,x,y,x,y,x,y,x,y,x,y]
> $graph->plot($line_one_data,$line_two_data,$line_three_data)
> As I said, each "line" has its own set of "x,y", and although they're all
> obviously numbers, they don't all have "y" results at the same "x intervals"
> so I need to be able to control them independently. Surely there's
> something that can accommodate this...?
Well the line doesn't do this, the X values are linear. However the
Scatter works like this. ie You set an maximum X value and the X
values are put in the corresponding places.
--
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 23rd May)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp
--- End Message ---
--- Begin Message ---
Hi Friends,
I don't remember the exact OP's question, but for graphing I use
the Google Chart API ; see:
http://code.google.com/apis/chart/#radar
For an overview of chart types, see:
http://code.google.com/apis/chart/types.html
HTH, Cor
----- Original Message -----
From: "tedd" <[email protected]>
To: <[email protected]>; <[email protected]>
Sent: Friday, June 05, 2009 7:31 PM
Subject: Re: [PHP] PHP Graphing Libraries...?
At 4:33 PM -0400 6/4/09, [email protected] wrote:
Hi All,
I'm currently looking for a quality (preferably open source) PHP
graphing library that will allow me to create various graphs and
plot points. I've seen several that do some amazing things, but
cost a fortune -- others are either limited, lack documentation, or
don't allow plotting of points for multiple entities within the same
graph.
Can anyone make any quality suggestions?
Best,
Michael
Michael:
All sorts of stuff out there -- check out GDGraph
Here's an example:
http://webbytedd.com/ccc/charts/
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Michael A. Peters wrote:
> PJ wrote:
>> Can't find anything on G or web - but I probably didn't try hard enough.
>> I am unable to set my virtual hosts to handle https.
>> I have apache22, mod_ssl, opnenssl and the httpd and httpd-vhosts.conf
>> files are set up "correctly" but directing a sensitive user information
>> page to an HTTPS page returns an error of "not found". The virtual hosts
>> works fine, except for HTTPS.
>> This is on my intranet for local developing.
>> TIA
>>
>
> By "not found" do you mean a 404 error from the https domain?
> If so, then you probably just have the DocumentRoot directive set up
> incorrectly for your secure domain.
>
The problem was and remains in httpd-ssl.conf. It is not at all clear
how the ssl.conf and the vhosts.conf files are related. The same site is
entered in https-ssl.conf and in httpd-vhosts.conf but uner different
ports *:80 and :*:443.
What is rather annoying is that in the ssl-conf file there is a dummy
setup but it does not indicate that this is what you have to change -
rather than the vhosts file. Nothing like having the blind leading the
blind. ;-)
I solved my immediate problem by modifying the httpd-ssl.conf file; up
to then I understood that the the configuration for vhosts depended on
the port where vhosts was pointing. Now, what is not clear is whether I
need to add more entries in the httpd-ssl.conf file for the other sites;
I would assume yes.
Thanks for responding. PJ
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Per Jessen wrote:
> PJ wrote:
>
>
>> Can't find anything on G or web - but I probably didn't try hard
>> enough.
>>
>
> Correct :-)
>
>
>> I am unable to set my virtual hosts to handle https.
>> I have apache22, mod_ssl, opnenssl and the httpd and httpd-vhosts.conf
>> files are set up "correctly" but directing a sensitive user
>> information page to an HTTPS page returns an error of "not found". The
>> virtual hosts works fine, except for HTTPS.
>> This is on my intranet for local developing.
>>
>
> Is your webserver listening for https requests? Port 443, check it
> with "netstat -ltn". Or check your "listen.conf" file.
>
> /Per
>
>
Thanks for responding.
The problem was muddy instructions for the setup. I finally figure it out.
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Shanon Swafford wrote:
>> -----Original Message-----
>> From: PJ [mailto:[email protected]]
>> Sent: Thursday, June 04, 2009 3:59 PM
>> To: [email protected]
>> Subject: [PHP] https setup
>>
>> Can't find anything on G or web - but I probably didn't try hard enough.
>> I am unable to set my virtual hosts to handle https.
>> I have apache22, mod_ssl, opnenssl and the httpd and httpd-vhosts.conf
>> files are set up "correctly" but directing a sensitive user information
>> page to an HTTPS page returns an error of "not found". The virtual hosts
>> works fine, except for HTTPS.
>> This is on my intranet for local developing.
>> TIA
>>
>
> ----------------------------------------------------------------------------
> -
>
> >From what I've found, it doesn't work like http. You can NOT do virtual
> hosts via https with apache listening on the same IP AND PORT. Something
> about the encrypted session is set up before the domain is analyzed by
> apache.
>
> You have to have a unique IP or PORT for each domain you want to serve with
> https.
>
> For example, if you want:
> https://example1.com
> and
> https://example2.com
>
> all on the same http server, you have to either:
>
> assign a separate IP for each domain and let apache do the vhost by IP
> or
> define a separate PORT for each domain and make apache do the vhost by PORT.
>
> If I'm wrong, somebody please let me know because I'd love to do vhosts like
> this as well.
>
> Regards,
> Shanon
>
>
>
I solved my problem. Problem was unclear directions for setup;
httpd-ssl.conf and httpd-vhosts.conf were not properly explalin for
configuration. The secure setup is done in the ssl file with the 443
port and the same host is repeated in the vhost file. I haven't
mentioned this, but my setup is with name-based vhosts, not address or
whatever...
So far as I can see, this should work fine for numerous hosts both on
whatever ports you choose plus the default 443 for ssl.
Don't forget, you have to have a certificate, real or dummy for this to
work. :-)
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Hi List,
I'm using the following code to output a file to the browser. Each file size
is in the range of 5-10MB, all of them are MP3.
header("Pragma: public");
> header("Expires: 0");
> header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
> header("Cache-Control: public");
> header("Content-Description: File Transfer");
> header("Content-Type: {$info['mimetype']}");
> header("Content-Disposition: attachment;
> filename=\"{$info['filename']}\"");
> header("Content-Transfer-Encoding: binary");
> header("Content-Length: " . $info['size']);
>
> set_time_limit(0);
>
> $file =
> @fopen($config['storage'][$config['current_storage']].$info['md5'].".".$info['extension'],"rb");
> if ($file) {
> while(!feof($file)) {
> print(fread($file, 1024*8));
> flush();
> if (connection_status()!=0) {
> @fclose($file);
> die();
> }
> }
> @fclose($file);
> }
I'm running this script on a VPS which has a 10MBIT connection. When I
posted a link to this download stream php file about 50 users started
download it, then the script stopped from sending the whole file (for
instance, the file is 5MB, the script sends 2MB, 1MB and it continue this
way).
In the apache log file I have seen these lines, but I have no idea what are
their meaning:
[Fri Jun 05 22:02:28 2009] [error] (12)Cannot allocate memory: fork: Unable
> to fork new process
> [Fri Jun 05 22:02:38 2009] [error] (12)Cannot allocate memory: fork: Unable
> to fork new process
> [Fri Jun 05 22:02:48 2009] [error] (12)Cannot allocate memory: fork: Unable
> to fork new process
> [Fri Jun 05 22:11:35 2009] [error] (12)Cannot allocate memory: fork: Unable
> to fork new process
>
I have no idea what's going on. Any ideas to solve this issue will be very
appreciated. My 12K users are suffering right now, I would really really
appreciate any idea in the right direction :) :) :)
Thank you!
--- End Message ---
--- Begin Message ---
My partner ran this command through SSH.
This is the returned value: (as root)
[r...@s1 ~]# ulimit -a
> core file size (blocks, -c) 0
> data seg size (kbytes, -d) unlimited
> file size (blocks, -f) unlimited
> pending signals (-i) 397311
> max locked memory (kbytes, -l) 32
> max memory size (kbytes, -m) unlimited
> open files (-n) 1024
> pipe size (512 bytes, -p) 8
> POSIX message queues (bytes, -q) 819200
> stack size (kbytes, -s) 10240
> cpu time (seconds, -t) unlimited
> max user processes (-u) 397311
> virtual memory (kbytes, -v) unlimited
> file locks (-x) unlimited
>
This is the output as the user files which runs my PHP files:
[fi...@s1 root]$ ulimit -a
> core file size (blocks, -c) 0
> data seg size (kbytes, -d) unlimited
> file size (blocks, -f) unlimited
> pending signals (-i) 397311
> max locked memory (kbytes, -l) 32
> max memory size (kbytes, -m) unlimited
> open files (-n) 1024
> pipe size (512 bytes, -p) 8
> POSIX message queues (bytes, -q) 819200
> stack size (kbytes, -s) 10240
> cpu time (seconds, -t) unlimited
> max user processes (-u) 397311
> virtual memory (kbytes, -v) unlimited
> file locks (-x) unlimited
>
I have no idea which of these settings can have an effect on my script, if
you have any idea that would be highly appreciated :)
Thanks!
On Fri, Jun 5, 2009 at 10:10 PM, Marc Steinert <[email protected]> wrote:
> Maybe your apache user is exceeding system limitations?
>
> For further detail have a look at
>
> http://www.ss64.com/bash/ulimit.html
>
> Greetings from Germany
>
> Marc
>
>
>
> Nitsan Bin-Nun wrote:
>
>> Hi List,
>>
>> I'm using the following code to output a file to the browser. Each file
>> size
>> is in the range of 5-10MB, all of them are MP3.
>>
>> header("Pragma: public");
>>
>>> header("Expires: 0");
>>> header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
>>> header("Cache-Control: public");
>>> header("Content-Description: File Transfer");
>>> header("Content-Type: {$info['mimetype']}");
>>> header("Content-Disposition: attachment;
>>> filename=\"{$info['filename']}\"");
>>> header("Content-Transfer-Encoding: binary");
>>> header("Content-Length: " . $info['size']);
>>>
>>> set_time_limit(0);
>>>
>>> $file =
>>>
>>> @fopen($config['storage'][$config['current_storage']].$info['md5'].".".$info['extension'],"rb");
>>> if ($file) {
>>> while(!feof($file)) {
>>> print(fread($file, 1024*8));
>>> flush();
>>> if (connection_status()!=0) {
>>> @fclose($file);
>>> die();
>>> }
>>> }
>>> @fclose($file);
>>> }
>>>
>>
>>
>>
>> I'm running this script on a VPS which has a 10MBIT connection. When I
>> posted a link to this download stream php file about 50 users started
>> download it, then the script stopped from sending the whole file (for
>> instance, the file is 5MB, the script sends 2MB, 1MB and it continue this
>> way).
>>
>> In the apache log file I have seen these lines, but I have no idea what
>> are
>> their meaning:
>>
>> [Fri Jun 05 22:02:28 2009] [error] (12)Cannot allocate memory: fork:
>> Unable
>>
>>> to fork new process
>>> [Fri Jun 05 22:02:38 2009] [error] (12)Cannot allocate memory: fork:
>>> Unable
>>> to fork new process
>>> [Fri Jun 05 22:02:48 2009] [error] (12)Cannot allocate memory: fork:
>>> Unable
>>> to fork new process
>>> [Fri Jun 05 22:11:35 2009] [error] (12)Cannot allocate memory: fork:
>>> Unable
>>> to fork new process
>>>
>>>
>>
>> I have no idea what's going on. Any ideas to solve this issue will be very
>> appreciated. My 12K users are suffering right now, I would really really
>> appreciate any idea in the right direction :) :) :)
>>
>> Thank you!
>>
>>
>
> --
> Synchronize and share your files over the web for free
> http://bithub.net/
>
> My Twitter feed
> http://twitter.com/MarcSteinert
>
>
>
>
>
--- End Message ---
--- Begin Message ---
if the problem is due to flow control issues between the script and the
httpd server then perhaps changing the approach could help.
i quit using this approach of writing files to the php output buffer a
little while ago. it seemed that it was better to leave the flow control
issues entirely to apache. so i wrote the file to a specific directory on
the server and redirected the client to it, using the apache directive on
that directory:
Header set Content-Disposition attachment
you can use that directive to send whatever headers you need.
On 6/5/09 3:52 PM, "Nitsan Bin-Nun" <[email protected]> wrote:
> Hi List,
>
> I'm using the following code to output a file to the browser. Each file size
> is in the range of 5-10MB, all of them are MP3.
>
> header("Pragma: public");
>> header("Expires: 0");
>> header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
>> header("Cache-Control: public");
>> header("Content-Description: File Transfer");
>> header("Content-Type: {$info['mimetype']}");
>> header("Content-Disposition: attachment;
>> filename=\"{$info['filename']}\"");
>> header("Content-Transfer-Encoding: binary");
>> header("Content-Length: " . $info['size']);
>>
>> set_time_limit(0);
>>
>> $file =
>> @fopen($config['storage'][$config['current_storage']].$info['md5'].".".$info[
>> 'extension'],"rb");
>> if ($file) {
>> while(!feof($file)) {
>> print(fread($file, 1024*8));
>> flush();
>> if (connection_status()!=0) {
>> @fclose($file);
>> die();
>> }
>> }
>> @fclose($file);
>> }
>
>
>
> I'm running this script on a VPS which has a 10MBIT connection. When I
> posted a link to this download stream php file about 50 users started
> download it, then the script stopped from sending the whole file (for
> instance, the file is 5MB, the script sends 2MB, 1MB and it continue this
> way).
>
> In the apache log file I have seen these lines, but I have no idea what are
> their meaning:
>
> [Fri Jun 05 22:02:28 2009] [error] (12)Cannot allocate memory: fork: Unable
>> to fork new process
>> [Fri Jun 05 22:02:38 2009] [error] (12)Cannot allocate memory: fork: Unable
>> to fork new process
>> [Fri Jun 05 22:02:48 2009] [error] (12)Cannot allocate memory: fork: Unable
>> to fork new process
>> [Fri Jun 05 22:11:35 2009] [error] (12)Cannot allocate memory: fork: Unable
>> to fork new process
>>
>
>
> I have no idea what's going on. Any ideas to solve this issue will be very
> appreciated. My 12K users are suffering right now, I would really really
> appreciate any idea in the right direction :) :) :)
>
> Thank you!
--- End Message ---