You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Lllllll Gabor <pr...@freemail.hu> on 2005/08/01 14:43:13 UTC

RE: [users@httpd] Sometimes getting 'Premature end of script...'

Thx for the advices, Owen!

I use MySQL, I read and write files in these scripts. User input
is not really intresting. It comes at the same values sometimes.

I also noticed that this error comes when I use Php-MyAdmin!
Different requests make these errors.
(Anyway I looked at its code and the header is correct.
I am sure there should not be errors like this in the MyAdmin scripts.)
So I guess that must be a problem of misconfiguration.

Anyway if someone can answear to me the following things it can
be useful:
1, Is it possible that MySQL 5.0.0a (alpha!) makes the problem?
    If so why I get php header error?
2, Can SafeMode solve such problems? If I turn it on makes the
    scripts more reliable? (Speed is not really needed in my case.)
3, Can u suggest some links about how to make the server more
    reliable? Programs would be also nice.

Gabor

Boyle Owen <Ow...@swx.com> írta:
> > Can someone help me to solve this?
> > 
> > Usually when I browse my php scripts they are fine.
> > But sometimes I get an 500 (internal server) error because
> > of 'Premature end of script headers: php.exe'.
> 
> This means that the PHP code failed before it got to the bit where it 
prints the response header ("content-type: text/html\n\n"). There is an 
occasional problem with your code which is not properly trapped. Do 
you access a DB?, write to a file? read from a file? do any calculations 
using user input? Any of these (and others) can cause a failure which 
depends on user input. To debug:
> 
> - Look in the access log and find the request which corresponds to 
the error (use the timestamp to cross-reference). Try to reproduce the 
fauilure by re-issuing the same request (ie, same user parameters).
> - If you need more information, activate ScriptLogging - see docs for 
details
> - Generally, don't trust user input - they can submit anything (words 
instead of numbers, numbers instead of words, even entire programs!)
> 
> > 
> > I read the faq but found only a few things about this.
> > 
> > How can I make it to work always?
> 
> You have to fix the bug in the PHP code.
> 
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored. 
> 
> > I use these:
> >   Apache 2.0.48
> >   Win XP
> >   Php 4.3.5
> > 
> > I already increased the "ThreadsPerChild" setting. Now it is 
> > better but
> > not perfect.
> > I also have the following settings in httpd.conf:
> > ScriptAlias /php/ "d:/Apache2/php/"
> > AddType application/x-httpd-php .php
> > Action application/x-httpd-php "/php/php.exe"
> > 
> > I would be happy about any ideas or comments about this.
> > 
> > Thanks,
> >   Gabor



_______________________________________________________________________
[freemail] extra 1GB-os postafiókkal, Önnek már van? http://freemail.hu



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] New to Web Development

Posted by John Hicks <jo...@gulfbridge.net>.
Executive Benefits Resources wrote:
> Sorry for the most elemental of situations but I am new to the web
> development arena and am interested in building WB-database applications
> for friends and family.  I used to be a programmer back in the early
> 70's (BAL, COBOL, FORTRAN, RPG, CRTs linked to mainframes, you get the
> picture) and I got nominated to build a web-based hobby/business.
> 
> I operate on a home network consisting of a laptop with MS-Office XP
> Standard and a desktop (my son's) with MS-Office XP Professional, both
> of which are Version 2002.  I am PC literate as it relates to MS Office,
> Excel, Word and PowerPoint and have never done anything through MS DOS.
> I have high speed internet through Road Runner.
> 
> I would like to initially build a web server and applications on my home
> network for learning/experimenting (no one but me will have access)
> before I venture out of my box.
> 
>>>From my initial very broad-based reading, it seems I should work with
> Apache, PHP and MySQL as well learn the basics of HTML and SQL which I
> have already started.
> 
> Does anyone have sources you can point me to and/or thoughts on how best
> to proceed without feeling totally overwhelmed moving forward with my
> new ambition?
> 
> Thanks for any empathy and I apologize if there was a better forum for
> my question,
> 
> Dave

Welcome, Dave.

I concur that the Apache, PHP, MySQL platform is the preferred route to 
take.

Both PHP and MySQL have excellent references on their web sites 
(complete with search facilities and user comments). In addition, both 
have very active and responsive mailing lists.

http://www.php.net/manual/en/langref.php
http://www.php.net/mailing-lists.php

http://dev.mysql.com/doc/mysql/en/index.html
http://lists.mysql.com/

If you have ever considered getting into Linux, this would be an 
excellent time to do so. Most Linux distributions include Apache, PHP, 
and MySQL -- all integrated and configured and ready to go. (The 
resulting combination is known as the LAMP platform -- for Linux, 
Apache, MySQL, PHP -- and is the most popular web development platform 
around.)

You should also be sure to have a good basic understanding of the HTTP 
protocol. Of all the prototcols in use on the Internet, HTTP is one of 
the simplest, but many developers skip this step ... to their detriment.

Beyond that, rather than list a lot of resources, let me just say:
--The Internet is full of excellent resources on web development
--Google is your friend

Good luck!

--John Hicks


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] New to Web Development

Posted by FSA <we...@proxy.ro>.
best documentation u can get at
for
apache: apache.org
mysql: www.mysql.com
php: www.php.net
u can get tutorial related sites or script exchange sites from this pages.

Executive Benefits Resources wrote:
> Sorry for the most elemental of situations but I am new to the web
> development arena and am interested in building WB-database applications
> for friends and family.  I used to be a programmer back in the early
> 70's (BAL, COBOL, FORTRAN, RPG, CRTs linked to mainframes, you get the
> picture) and I got nominated to build a web-based hobby/business.
> 
> I operate on a home network consisting of a laptop with MS-Office XP
> Standard and a desktop (my son's) with MS-Office XP Professional, both
> of which are Version 2002.  I am PC literate as it relates to MS Office,
> Excel, Word and PowerPoint and have never done anything through MS DOS.
> I have high speed internet through Road Runner.
> 
> I would like to initially build a web server and applications on my home
> network for learning/experimenting (no one but me will have access)
> before I venture out of my box.
> 
> From my initial very broad-based reading, it seems I should work with
> Apache, PHP and MySQL as well learn the basics of HTML and SQL which I
> have already started.
> 
> Does anyone have sources you can point me to and/or thoughts on how best
> to proceed without feeling totally overwhelmed moving forward with my
> new ambition?
> 
> Thanks for any empathy and I apologize if there was a better forum for
> my question,
> 
> Dave
> -----Original Message-----
> From: Lllllll Gabor [mailto:problem2@freemail.hu] 
> Sent: Monday, August 01, 2005 7:43 AM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] Sometimes getting 'Premature end of
> script...'
> 
> Thx for the advices, Owen!
> 
> I use MySQL, I read and write files in these scripts. User input
> is not really intresting. It comes at the same values sometimes.
> 
> I also noticed that this error comes when I use Php-MyAdmin!
> Different requests make these errors.
> (Anyway I looked at its code and the header is correct.
> I am sure there should not be errors like this in the MyAdmin scripts.)
> So I guess that must be a problem of misconfiguration.
> 
> Anyway if someone can answear to me the following things it can
> be useful:
> 1, Is it possible that MySQL 5.0.0a (alpha!) makes the problem?
>     If so why I get php header error?
> 2, Can SafeMode solve such problems? If I turn it on makes the
>     scripts more reliable? (Speed is not really needed in my case.)
> 3, Can u suggest some links about how to make the server more
>     reliable? Programs would be also nice.
> 
> Gabor
> 
> Boyle Owen <Ow...@swx.com> írta:
> 
>>>Can someone help me to solve this?
>>>
>>>Usually when I browse my php scripts they are fine.
>>>But sometimes I get an 500 (internal server) error because
>>>of 'Premature end of script headers: php.exe'.
>>
>>This means that the PHP code failed before it got to the bit where it 
> 
> prints the response header ("content-type: text/html\n\n"). There is an 
> occasional problem with your code which is not properly trapped. Do 
> you access a DB?, write to a file? read from a file? do any calculations
> 
> using user input? Any of these (and others) can cause a failure which 
> depends on user input. To debug:
> 
>>- Look in the access log and find the request which corresponds to 
> 
> the error (use the timestamp to cross-reference). Try to reproduce the 
> fauilure by re-issuing the same request (ie, same user parameters).
> 
>>- If you need more information, activate ScriptLogging - see docs for 
> 
> details
> 
>>- Generally, don't trust user input - they can submit anything (words 
> 
> instead of numbers, numbers instead of words, even entire programs!)
> 
>>>I read the faq but found only a few things about this.
>>>
>>>How can I make it to work always?
>>
>>You have to fix the bug in the PHP code.
>>
>>Rgds,
>>Owen Boyle
>>Disclaimer: Any disclaimer attached to this message may be ignored. 
>>
>>
>>>I use these:
>>>  Apache 2.0.48
>>>  Win XP
>>>  Php 4.3.5
>>>
>>>I already increased the "ThreadsPerChild" setting. Now it is 
>>>better but
>>>not perfect.
>>>I also have the following settings in httpd.conf:
>>>ScriptAlias /php/ "d:/Apache2/php/"
>>>AddType application/x-httpd-php .php
>>>Action application/x-httpd-php "/php/php.exe"
>>>
>>>I would be happy about any ideas or comments about this.
>>>
>>>Thanks,
>>>  Gabor
> 
> 
> 
> 
> _______________________________________________________________________
> [freemail] extra 1GB-os postafiókkal, Önnek már van? http://freemail.hu
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 



Re: [users@httpd] New to Web Development

Posted by Nick Jones <ni...@yahoo.com>.
<EB...@kc.rr.com> wrote:

> Sorry for the most elemental of situations but I am
> new to the web
> development arena and am interested in building
> WB-database applications
> for friends and family.  I used to be a programmer
> back in the early
> 70's (BAL, COBOL, FORTRAN, RPG, CRTs linked to
> mainframes, you get the
> picture) and I got nominated to build a web-based
> hobby/business.

Sounds like WE could all learn a thing or two from
YOU!

> I operate on a home network consisting of a laptop
> with MS-Office XP
> Standard and a desktop (my son's) with MS-Office XP
> Professional, both
> of which are Version 2002.  I am PC literate as it
> relates to MS Office,
> Excel, Word and PowerPoint and have never done
> anything through MS DOS.
> I have high speed internet through Road Runner.

IMO, the best tool a web developer can have is a good
text editor. But I digress. When I had RoadRunner
internet, I ran my own web server on my network. You
just need to give it it's own IP address, or set up
port forwarding from your router. Most DNS providers
offer a dynamic IP service. You set up a program on
your server that automatically detects and updates
your IP with the DNS provider. I had this setup for
several months and it worked like a charm.

> I would like to initially build a web server and
> applications on my home
> network for learning/experimenting (no one but me
> will have access)
> before I venture out of my box.
> 
> From my initial very broad-based reading, it seems I
> should work with
> Apache, PHP and MySQL as well learn the basics of
> HTML and SQL which I
> have already started.

Excellent idea. I noticed another user reccomended you
set up a Linux box. I second that wholeheartedly. You
can use an old throwaway PC or one that someone is
getting rid of. Just set up a good Linux distro
without a GUI or any of the fancy stuff you don't need
and it will make a fine web/php/MySQL server. I've got
an old K6 266Mhz with 72mb of RAM on my internal
network doing just that. It also makes a handy MP3
server so I can listen at any computer in the house
(and even my Xbox!)
 
> Does anyone have sources you can point me to and/or
> thoughts on how best
> to proceed without feeling totally overwhelmed
> moving forward with my
> new ambition?
> 
> Thanks for any empathy and I apologize if there was
> a better forum for
> my question,
> 
> Dave

Good luck and welcome to PHP!
-Nick

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] New to Web Development

Posted by Executive Benefits Resources <EB...@kc.rr.com>.
Sorry for the most elemental of situations but I am new to the web
development arena and am interested in building WB-database applications
for friends and family.  I used to be a programmer back in the early
70's (BAL, COBOL, FORTRAN, RPG, CRTs linked to mainframes, you get the
picture) and I got nominated to build a web-based hobby/business.

I operate on a home network consisting of a laptop with MS-Office XP
Standard and a desktop (my son's) with MS-Office XP Professional, both
of which are Version 2002.  I am PC literate as it relates to MS Office,
Excel, Word and PowerPoint and have never done anything through MS DOS.
I have high speed internet through Road Runner.

I would like to initially build a web server and applications on my home
network for learning/experimenting (no one but me will have access)
before I venture out of my box.

>From my initial very broad-based reading, it seems I should work with
Apache, PHP and MySQL as well learn the basics of HTML and SQL which I
have already started.

Does anyone have sources you can point me to and/or thoughts on how best
to proceed without feeling totally overwhelmed moving forward with my
new ambition?

Thanks for any empathy and I apologize if there was a better forum for
my question,

Dave
-----Original Message-----
From: Lllllll Gabor [mailto:problem2@freemail.hu] 
Sent: Monday, August 01, 2005 7:43 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Sometimes getting 'Premature end of
script...'

Thx for the advices, Owen!

I use MySQL, I read and write files in these scripts. User input
is not really intresting. It comes at the same values sometimes.

I also noticed that this error comes when I use Php-MyAdmin!
Different requests make these errors.
(Anyway I looked at its code and the header is correct.
I am sure there should not be errors like this in the MyAdmin scripts.)
So I guess that must be a problem of misconfiguration.

Anyway if someone can answear to me the following things it can
be useful:
1, Is it possible that MySQL 5.0.0a (alpha!) makes the problem?
    If so why I get php header error?
2, Can SafeMode solve such problems? If I turn it on makes the
    scripts more reliable? (Speed is not really needed in my case.)
3, Can u suggest some links about how to make the server more
    reliable? Programs would be also nice.

Gabor

Boyle Owen <Ow...@swx.com> írta:
> > Can someone help me to solve this?
> > 
> > Usually when I browse my php scripts they are fine.
> > But sometimes I get an 500 (internal server) error because
> > of 'Premature end of script headers: php.exe'.
> 
> This means that the PHP code failed before it got to the bit where it 
prints the response header ("content-type: text/html\n\n"). There is an 
occasional problem with your code which is not properly trapped. Do 
you access a DB?, write to a file? read from a file? do any calculations

using user input? Any of these (and others) can cause a failure which 
depends on user input. To debug:
> 
> - Look in the access log and find the request which corresponds to 
the error (use the timestamp to cross-reference). Try to reproduce the 
fauilure by re-issuing the same request (ie, same user parameters).
> - If you need more information, activate ScriptLogging - see docs for 
details
> - Generally, don't trust user input - they can submit anything (words 
instead of numbers, numbers instead of words, even entire programs!)
> 
> > 
> > I read the faq but found only a few things about this.
> > 
> > How can I make it to work always?
> 
> You have to fix the bug in the PHP code.
> 
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored. 
> 
> > I use these:
> >   Apache 2.0.48
> >   Win XP
> >   Php 4.3.5
> > 
> > I already increased the "ThreadsPerChild" setting. Now it is 
> > better but
> > not perfect.
> > I also have the following settings in httpd.conf:
> > ScriptAlias /php/ "d:/Apache2/php/"
> > AddType application/x-httpd-php .php
> > Action application/x-httpd-php "/php/php.exe"
> > 
> > I would be happy about any ideas or comments about this.
> > 
> > Thanks,
> >   Gabor



_______________________________________________________________________
[freemail] extra 1GB-os postafiókkal, Önnek már van? http://freemail.hu



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org