![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Oct 2003
Posts: 3,191
|
a question for php gurus
ok, so i needed to make a few very important pages in "php" on a few websites.
then something happens on the server, maybe mySQL can't connect or the mySQL datatbase gets corrupted somehow. and then this very important web page does not load. is there a general setting in php that makes it tolerant of failure? what i'm asking is---is there a way to configure it on the server so the php page will always load no matter what happens. any advice appreciated! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Mar 2003
Location: ::::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::||||||||||||:::::: :::::::::::||::::::::::: :::::::::::||::::::::::: ::::::::::::::::::::::::
Posts: 7,197
|
wtf.
If my computer breaks can you make it still work with some setting? ![]()
__________________
Amen |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Registered User
Join Date: Sep 2003
Location: Ohio
Posts: 72
|
Always back up!! back up!! back up!! Before
![]() Permissions?
__________________
Xdream |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Oct 2003
Posts: 3,191
|
for example, if there is a problem with hahahahahahahahahaha, a page can still function---the hahahahahahahahahaha may be wrong, but the page will load, it will say "done, error on page" etc in task bar.
sometimes when php fails the page won't load at all. that's what i'm trying to avoid. i'll bet someone here knows the answer for this. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Oct 2003
Posts: 3,191
|
certainly, i have a backup.
the issue is, the pages involved are key pages in a website tour which need php for some trick autoupdating. and if something fails (like a failure at my host with their mySQL server) the darn page won't load. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
So Fucking Banned
Join Date: Aug 2002
Posts: 5,579
|
It depends on the functions you're using, you can suppress error output but some functions will end the script if they fail, others will just return the error message and try to continue.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Oct 2003
Posts: 3,191
|
Quote:
ok Rorschach, i knew there were some smart guys here ![]() is there a "general" setting that you would change to build in "fault tolerance"? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
So Fucking Banned
Join Date: Aug 2002
Posts: 5,579
|
I'm no PHP guru but I don't think so, AFAIK it's more an issue of each individual function. For example, IIRC, include() will return an error if it fails and try to continue, whereas require() will end the execution of the script if it fails. There are options in php.ini that you can use to determine the level of error reporting, and you can use @ in front of function names to suppress errors, but there's nothing that's going to change the way a function fundamentally works short of rewriting it.
One way to get around fatal errors is to use if/else statements - eg in psuedo code if(function()) { do this; } else { print error; } Maybe someone else can shed more light on an answer. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Join Date: Oct 2003
Posts: 3,191
|
Quote:
Rorschach, i appreciate your thoughts on this. but i don't want to re-write the script i'm using. it a commerically avail script (autolinkspro) that i'm using to automatically update (every 15 minutes in this case) certain images on a tour which contain a link to a sample video. the reason i use this instead of a random js is because it prevents the surfer from just refreshing the page and downloading the next video sample---it's a bandwidth saver. the problem here is that this is a key page in the tour. a couple times in the last month something has happened at my host (got errors of "can't connect to mySQL server") which caused this important page to not load---which then completely destroys the tour. and these sorts of things always seem to happen at 3am and you don't notice something is wrong until you look at your sales figures and wonder why you aren't getting signups on the domain, and then you go check it and the darn page is loading. so i'm looking for a way to tweak the general php settings on the server, so if php has problems, at least the page will still load even if the php parts of the page won't load. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
salad tossing sig guy
Join Date: Apr 2002
Location: mrthumbs*gmail.com
Posts: 11,702
|
really simple
just end every mysql query with the mysql_error() routine and instruct your script to kill everything or redirect to another page in case of an error.. http://php.net/mysql_eror |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Registered User
Join Date: Jun 2002
Posts: 62
|
Also, by pre-pending the "@" symbol to php specific functions it will supress errors...such as @include or @mysql_connect(...)
Just my two cents... -Mr. T
__________________
Mr. T! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Oct 2003
Posts: 3,191
|
gentleman, thank you all.
but, would it not be simpler to just alter the general php settings on the server? (as opposed to altering the script) for example, just take a look at "mydomain.com/phpinfo.php" and make a change to the general php config to build in some fault tolerance. i cannot solve the problem this way? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
So Fucking Banned
Join Date: Aug 2002
Posts: 5,579
|
If you want a really easy solution, put all your images into a directory named by date, and call the image names dynamically according to what day it is.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 | |
Confirmed User
Join Date: Oct 2003
Posts: 3,191
|
Quote:
well that sounds good, but what i'm doing is more complicated. this autolinks script does some neat things, it allows me to show a dynamically changed image, with it's unique description, which links to a unique html sales page, which links to a unique "sample video" every 15 minutes. this is the house of cards i'm trying to keep from falling, and it only falls apart when there is a php error. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |