Webmaster Forum

Sponsored Reviews   PR6 Link Building Service   V7N Directory
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Reply
 
LinkBack Thread Tools Display Modes
Old 03-06-2006, 10:20 PM   #1 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
PHP "Service Unavailable" caused by code error?

I am totally puzzled by this. I have a script that was working fine for months, now it's giving me an error "Service Temporarily Unavailable" half the time. It's a simple script, where you pass it some text and a few options and it prints it to a graphic and saves it as a gif. Now it's being picky about what text it will print, giving that error when it refuses. I can't correlate any particular change in text to when it errs. And I don't understand why my error handling doesn't work and it gives me the generic Sevice Unavailble error instead of giving a code error.


I've tried several different text strings, just random things, and made a list to try to identify what it's not liking, but like i said, i see no pattern.
For example this works just fine:

mystatus2.php?username=gnznroses&password=PASSWORD &text=*BFreeGadgets4Me%20%20:%20%20*GReceived%2 0$2 25*B||FreeComputerAddons%20%20:%20%20*GReceived%20 DVD%20Burner&font=crystal_clear&background=white

yet this doesn't:
mystatus2.php?username=gnznroses&password=PASSWORD &text=*BFreeGadge%20%20%20%20%20%20teive225*B||Fre eComp%20%20%20%20utner*B||Tr%20%20oon*B||Free%20%2 0%20%20%20%20Pae*B||&font=crystal_clear&background =white

Last edited by gnznroses : 03-06-2006 at 10:26 PM.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 03-09-2006, 08:58 AM   #2 (permalink)
Contributing Member
 
jwalsh's Avatar
 
Join Date: 03-22-04
Location: Cleveland, OH
Posts: 388
iTrader: 0 / 0%
jwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to alljwalsh is a name known to all
run a phpinfo() and post results.
__________________
I may not be Jakob Nielson, but I care an awful lot about making usable websites.
jwalsh is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-09-2006, 02:02 PM   #3 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
not sure which part you need, so here's the whole thing:
http://bashfreebieguide.com/mystatus/info.php


someone told me that an error 503 like this means the server is down and that for the script to cause it that the script is bringing down the server, but i don't believe that. if it were my host would be yelling at me... but i do think it's some server problem, cause like i said it was working and i din;t change a thing, and now it isn't. tho i dunno what could change on the server to cause the script to accept some text in the query string and not other. if it helps, and if anyone actually wants to look at it, i can post the php source.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-09-2006, 02:49 PM   #4 (permalink)
Inactive
 
veridicus's Avatar
 
Join Date: 01-18-06
Posts: 139
iTrader: 0 / 0%
veridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really nice
Service Unavailable should never be caused by your code (unless of course you're intentionally sending back a 503). You could be crashing (more likely in PHP5 than 4) or your server may be having some other problem.
veridicus is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-10-2006, 07:05 PM   #5 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
hmm, if it were crashing the server wouldn't that mean everything on the server would be down at that time? i don't think that's likely cause liek i said, my host would be notifying me of it. i ahve no doubt tho that the script, and so the code, is directly or indirectly causing it. because the results can be reproduced every single time, given different query strings. here's the list i have so far if you want to try them yourselves.

Code:
this is the url i wanted to use and which i based the rest off of. it causes a 503 error. http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgets4Me%20%20:%20%20*GReceived%20$225*B||FreeComputerAddons%20%20:%20%20*GReceived%20DVD%20Burner*B||Trainn:%20YourFreeFlatscreen:%20%20*GShipping%20Soon*B||FreePay:%20PCs:%20%20*GReceived%20:)*B||&font=crystal_clear&background=white these work fine: http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgets4Me%20%20:%20%20*GReceived%20$225*B||FreeComputerAddons%20%20:%20%20*GReceived%20DVD%20Burner&font=crystal_clear&background=white http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgets4Me%20%20:%20%20*GReceived%20$225*B||FreePay:%20PCs:%20%20*GReceived%20:)&font=crystal_clear&background=white http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgets4M%20$225*B||Fner*B||T&font=crystal_clear&background=white http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgeteive225*B||FreeComputner*B||Troon*B||FreePae*B||&font=crystal_clear&background=white ^has all the text, but chopped out in the middle http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadge------------teive225*B||FreeComp----------utner*B||Tr--------oon*B||Free------------Pae*B||&font=crystal_clear&background=white these don't work: http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgets4Me%20%20:%20%20*GReceived%20$225*B||FreeComputerAddons%20%20:%20%20*GReceived%20DVD%20Burner*B||Trainn:%20YourFreeFlatscreen:%20%20*GShipping%20Soon&font=crystal_clear&background=white http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgets4Me%20%20:%20%20*GReceived%20$225*B||FreeComputerAddons%20%20:%20%20*GReceived%20DVD%20Burner*B||FreePay:%20PCs:%20%20*GReceived%20:)&font=crystal_clear&background=white http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadgets4Me%20%20:%20%20*GReceived%20$225*B||FreePay:%20PCs:%20%20*GReceived%20:)*B||Trainn:%20YourFreeFlatscreen:%20%20*GShipping%20Soon&font=crystal_clear&background=white http://bashfreebieguide.com/mystatus/mystatus2.php?username=test&password=test&text=*BFreeGadge%20%20%20%20%20%20teive225*B||FreeComp%20%20%20%20utner*B||Tr%20%20oon*B||Free%20%20%20%20%20%20Pae*B||&font=crystal_clear&background=white ^same as the working one with added %20s
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-11-2006, 12:10 PM   #6 (permalink)
Inactive
 
veridicus's Avatar
 
Join Date: 01-18-06
Posts: 139
iTrader: 0 / 0%
veridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really niceveridicus is just really nice
When I say crash I mean the PHP process crashing. That'll only bring down that one process and not the whole server, so the server can keep taking other requests.

For example, in the original release of PHP5, if you define a function and in that function make a global declaration to a variable which doesn't exist, then reference that variable, the PHP process will crash. Your apache error log should give some indication of memory allocation failure or something obscure like that.

Your URLs themselves have nothing to do with the error you're getting. It's definitely the code or something the code is doing to the server. Are your error logs showing anything interesting?
veridicus is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-11-2006, 12:47 PM   #7 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
my last host had cpanel and you accessed logs form it, i forgot i can ftp to the logs with my new host... i checked and there is mention of the errors, but i don't know what it means:

[Fri Mar 10 06:35:54 2006] [error] [client 24.63.184.224] mod_security: Access denied with code 503. Pattern match "\\|+.*[\\x20].*[\\x20].*\\|" at THE_REQUEST. [hostname "bashfreebieguide.com"] [uri "/mystatus/mystatus2.php?username=USER&password=PASS&text=Any Gift4Two%20%20:%20%20*G0%20/%202*B||FreePay:%20GiftCards%20%20:%20%20*G4%20/%205%20%20*Y(1%20Pending)*B||FreePay:%20Laptops%20 %20:%20%20*G0%20/%2020*B||FreePay:%20PS3s%20%20:%20%20*G0%20/%208*B||FreePay:%20PSPs%20%20:%20%20*G0%20/%205*B||FreePay:%20XBox360s%20%20:%20%20*G0%20/%208*B||Trainn:%20YourPS34free%20%20:%20%20*G0&fon t=gapstown&background=transparent"]


etc.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-11-2006, 03:17 PM   #8 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
hmm, don't see a way to just Edit....

anyways, what's that "pattern match" crap it's taking about? i do some string replacements, and some InStr or whatever, but i would think any errors with that would just cause a normal error and tell me the line number it happened at.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-11-2006, 08:28 PM   #9 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,857
iTrader: 0 / 0%
Latest Blog:
None

kwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to behold
Send a message via AIM to kwvarga
try turn error logging on E_ALL
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is online now  
Add Post to del.icio.us
Reply With Quote
Old 03-11-2006, 08:45 PM   #10 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
umm, did that, but for some reason i have an error.log that was only last updated hours ago. it only has some file not found errors. those are in another access.log.2006-03-10 which obviously was not updated since yesterday. dunno why...

looking at the pattern, from my understanding it matched this:
at least one | followed by any char (or no char at all), followed by a space, then any (or no) char, then another |
and deemed that a security risk...

-edit-
that pattern matching as i've figured out can't be right or else none of the links i posted earlier would work, cause all of em would have a match...

Last edited by gnznroses : 03-11-2006 at 09:03 PM.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-11-2006, 10:00 PM   #11 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
edit button is gone again... must be a time-based thing... anyways,

i was wrong, my error.log does have the latest errors. they're at the end of the file, not the beginning like my old host. i don't see any difference tho with the E_ALL turned on.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-11-2006, 10:45 PM   #12 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,857
iTrader: 0 / 0%
Latest Blog:
None

kwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to beholdkwvarga is a splendid one to behold
Send a message via AIM to kwvarga
strange, might be causing a strange memory error

try asking your host to see if they have any idea
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is online now  
Add Post to del.icio.us
Reply With Quote
Old 03-12-2006, 02:43 AM   #13 (permalink)
Contributing Member
 
WorldwideTrading's Avatar
 
Join Date: 01-22-06
Location: Exeter, East Devon, England, UK
Posts: 768
iTrader: 0 / 0%
Latest Blog:
None

WorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really niceWorldwideTrading is just really nice
Your host may have installed a hotfix to address a security vunerability and your script is now no considerd to be secure.
__________________
.: Devon Websites :: Golf Holiday in Tenerife :.
WorldwideTrading is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-12-2006, 07:02 AM   #14 (permalink)
Technical Support
 
Paul M's Avatar
 
Join Date: 12-14-05
Posts: 127
iTrader: 0 / 0%
Paul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of lightPaul M is a glorious beacon of light
The relevant bit is in bold;

Quote:
Originally Posted by gnznroses
[Fri Mar 10 06:35:54 2006] [error] [client 24.63.184.224] mod_security: Access denied with code 503.
You host has the apache mod_security module installed and your url is falling foul of one of the its rules.
Paul M is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-12-2006, 01:16 PM   #15 (permalink)
Contributing Member
 
Join Date: 12-14-05
Posts: 109
iTrader: 0 / 0%
Latest Blog:
None

gnznroses is on the right pathgnznroses is on the right path
i figured it out. i think it was looking for a || in the url. so i simply changed it so that it uses ;; instead and now it works fine i was using the || just to represent a linebreak.
gnznroses is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google's "Unavailable After" Meta Tag Live peter_d Google Forum 6 08-03-2007 04:30 PM
Need help with creating an "error" on registration :) Alternus Coding Forum 2 06-10-2007 07:36 AM
PHP: What is code for "Only user with avatar" - i am using vbulletin basketmen Coding Forum 3 04-17-2007 07:40 AM
"Method POST not allowed" error east_pole Web Design Lobby 3 02-16-2007 02:57 PM
Home page with "latest news", "news archive" and "update" tekitouni Web Design Lobby 1 09-19-2006 07:39 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 05:53 PM.
© Copyright 2008 V7 Inc


Search Engine Optimization by vBSEO 3.1.0 ©2007, Crawlability, Inc.