dflow Posted February 8, 2009 Share Posted February 8, 2009 hi i have a script that does the follow: presents html saves the html to a folder and renames the file now the file is only 70kb max the problem i have is that i get a server problem 500, my hosting says that the script takes to long i went over the script with a programmer friend of mine and it is fine. we thought maybe the time it takes from time a request is sent to the time it reaches the server is too long i work a lot from coffee places with wifi my the internet connections? you thoughts and advise thanks Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/ Share on other sites More sharing options...
.josh Posted February 8, 2009 Share Posted February 8, 2009 70kb isn't much even by standards 10 years ago. If you are going through different wifi connects and have no issues with connection speed for other sites, then the problem is with the script or with the server. Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-757563 Share on other sites More sharing options...
dflow Posted February 8, 2009 Author Share Posted February 8, 2009 there are issues with the connection speed , but how does that matter? isn't the http request sent to server and processed on the server "time? Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-757572 Share on other sites More sharing options...
.josh Posted February 8, 2009 Share Posted February 8, 2009 It's possible that your connection could cause it, but it's more likely the script or server. But there's no way for me to confirm it without looking at the script or knowing nothing about the server. Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-757585 Share on other sites More sharing options...
dflow Posted February 9, 2009 Author Share Posted February 9, 2009 the script: <?php require_once('../Connections/international.php'); ?> <?php $colname_RsProductProposed = "1"; if (isset($HTTP_GET_VARS['PID'])) { $colname_RsProductProposed = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['PID'] : addslashes($HTTP_GET_VARS['PID']); } mysql_select_db($database_international, $international); $query_RsProductProposed = sprintf("SELECT * FROM products WHERE ProductID = %s", $colname_RsProductProposed); $RsProductProposed = mysql_query($query_RsProductProposed, $international) or die(mysql_error()); $row_RsProductProposed = mysql_fetch_assoc($RsProductProposed); $totalRows_RsProductProposed = mysql_num_rows($RsProductProposed); ?> <?php $colname_RsServiceVoucher = "1"; if (isset($HTTP_GET_VARS['RID'])) { $colname_RsServiceVoucher = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['RID'] : addslashes($HTTP_GET_VARS['RID']); } mysql_select_db($database_international, $international); $query_RsServiceVoucher = sprintf("SELECT * FROM contact_form WHERE RequestID = %s", $colname_RsServiceVoucher); $RsServiceVoucher = mysql_query($query_RsServiceVoucher, $international) or die(mysql_error()); $row_RsServiceVoucher = mysql_fetch_assoc($RsServiceVoucher); $totalRows_RsServiceVoucher = mysql_num_rows($RsServiceVoucher); $colname_RsSupplierInfo = "1"; if (isset($HTTP_GET_VARS['SupID'])) { $colname_RsSupplierInfo = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['SupID'] : addslashes($HTTP_GET_VARS['SupID']); } mysql_select_db($database_international, $international); $query_RsSupplierInfo = sprintf("SELECT * FROM suppliers WHERE SupplierID = %s", $colname_RsSupplierInfo); $RsSupplierInfo = mysql_query($query_RsSupplierInfo, $international) or die(mysql_error()); $row_RsSupplierInfo = mysql_fetch_assoc($RsSupplierInfo); $totalRows_RsSupplierInfo = mysql_num_rows($RsSupplierInfo); ?> <html> <head> <title>Service Voucher and Reservation/Booking Confirmation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" link="#666666" vlink="#333333" alink="#999999"> <table width="600" border="0" cellspacing="10" cellpadding="0" align="center"> <tr> <td><img src="http://mysite.com/images/logo_143_59.gif"></td> </tr> <tr> <td></td> </tr> <tr> <td><div align="center"><font size="2" face="Arial, Helvetica, sans-serif">Tel: e-mail: <b>[email protected]</b></font></div></td> </tr> <tr> <td height="2" bgcolor="#CCCCCC"><font face="Arial, Helvetica, sans-serif"> </font></td> </tr> <tr> <td> <p align="left" style="font-family:verdana, arial,sans-serif;font-size:10pt;text-align:center;margin-top:0"><font face="Arial, Helvetica, sans-serif"><b>CONFIRMATION VOUCHER - RESERVATION/BOOKING NUMBER - <font size="2"><?php echo $row_RsServiceVoucher['SupplierBookingReferrence']; ?><br> </font></b></font></td> </tr> <tr> <td><div align="center"><font face="Arial, Helvetica, sans-serif"><b><font size="2">Date<?php echo $row_RsServiceVoucher['timestamp']; ?> mysite Reservation Number 1458<?php echo $row_RsServiceVoucher['RequestID']; ?>x4rvs</font></b></font></div></td> </tr> <tr> <td> <table width="580" border="0" cellspacing="1" cellpadding="3"> <tr valign="top" bgcolor="#3399FF"> <td width="153" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"> First Name: </td> <td width="424" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"><font size="2" face="Arial, Helvetica, sans-serif"><?php echo $row_RsServiceVoucher['CustomerFirstName']; ?></font></p></td> </tr> <tr valign="top" bgcolor="#3399FF"> <td width="153" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0">Last Name: </td> <td width="424" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"><font size="2" face="Arial, Helvetica, sans-serif"><?php echo $row_RsServiceVoucher['CustomerLastName']; ?></font></p></td> </tr> <tr bgcolor="#3399FF"> <td width="153" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0">Arrival Date: </td> <td width="424" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"><font face="Arial, Helvetica, sans-serif"><b><?php echo $row_RsServiceVoucher['DepartureDate']; ?></b></font></p></td> </tr> <tr bgcolor="#3399FF"> <td width="153" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0">Departure Date: </td> <td width="424" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"><font face="Arial, Helvetica, sans-serif"><b><?php echo $row_RsServiceVoucher['ReturnDate']; ?></b></font></p></td> </tr> <tr bgcolor="#3399FF"> <td width="153" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0">Number of Nights: </td> <td width="424" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"><font face="Arial, Helvetica, sans-serif"><b><?php echo $row_RsServiceVoucher['num_nights']; ?></b></font></p></td> </tr> <tr bgcolor="#3399FF"> <td height="20"><font size="2">Adults / Children</font></td> <td height="20"><p><font face="Arial, Helvetica, sans-serif"><strong><font size="2"><?php echo $row_RsServiceVoucher['TotalNumberAdults']; ?>/<?php echo $row_RsServiceVoucher['TotalNumberChildren']; ?></font></strong></font></p></td> </tr> <tr bgcolor="#3399FF"> <td colspan=2> <TABLE width=100% border=1 cellspacing=0 cellpadding=0 align='center'> <TR> <TD height=20><B> <p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'>Apartment / Service</TD> <TD align=center><B> <p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'>Date From</TD> <TD align=center><B> <p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'>Date To</TD> <TD align=center><B> <p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'>No.of Nights</TD> <TD align=center><B> <p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'>No Of People</TD> <TD align=right><B> <p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'> Payment on Site</TD> </TR> <TR> <TD height=20><p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><?php echo $row_RsServiceVoucher['ProductID']; ?></TD> <TD align=center><p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><b><?php echo $row_RsServiceVoucher['DepartureDate']; ?></b></TD> <TD align=center><p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><b><?php echo $row_RsServiceVoucher['ReturnDate']; ?></b></TD> <TD align=center><p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><b><?php echo $row_RsServiceVoucher['num_nights']; ?></b></TD> <TD align=center><p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><?php echo $row_RsServiceVoucher['TotalNumber']; ?></TD> <TD align=right><p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><?php echo $row_RsServiceVoucher['PAYTOSUPPLIER']; ?> <?php /*START_PHP_SIRFCIT*/ if ($row_RsProductProposed['CountryID']!="100"){ ?> € <?php } /*END_PHP_SIRFCIT*/ ?> <?php /*START_PHP_SIRFCIT*/ if ($row_RsProductProposed['CountryID']=="100"){ ?> $ <?php } /*END_PHP_SIRFCIT*/ ?> </TD> </TR> <TR valign="top"> <TD height=20 colspan="6"><p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><strong>APARTMENT ADDRESS:</strong></TD> </TR> <TR valign="top"> <TD height=20 colspan="6"><B> <p style='font-family:verdana, arial,sans-serif;font-size:8pt;margin-top:0'><?php echo $row_RsProductProposed['ProductAddress']; ?></TD> </TR> </TABLE></td> </tr> <tr bgcolor="#3399FF"> <td width="153" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0">Remainder due :</td> <td width="424" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"><font face="Arial, Helvetica, sans-serif"><?php echo $row_RsServiceVoucher['PAYTOSUPPLIER']; ?> <?php /*START_PHP_SIRFCIT*/ if ($row_RsProductProposed['CountryID']!="100"){ ?> € <?php } /*END_PHP_SIRFCIT*/ ?> <?php /*START_PHP_SIRFCIT*/ if ($row_RsProductProposed['CountryID']=="100"){ ?> $ <?php } /*END_PHP_SIRFCIT*/ ?> </font></p></td> </tr> <tr bgcolor="#3399FF"> <td height="20" colspan=2> <p style="font-family:verdana, arial,sans-serif;font-size:6pt;text-align:center;margin-top:0"> <tr bgcolor="#3399FF"> <td height="20" colspan="2"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0">Contact Person Details: <?php echo $row_RsSupplierInfo['KeysContactPersonName']; ?> <?php echo $row_RsProductProposed['ProductOwnerInfo']; ?> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"> </p></td> </tr> <tr bgcolor="#3399FF"> <td height="20" colspan="2" valign="top"><p>Mobile:<?php echo $row_RsSupplierInfo['KeysContactPersonMobile']; ?><?php echo $row_RsProductProposed['ProductOwneMobile']; ?><br> <br> </p></td> </tr> <tr bgcolor="#3399FF"> <td height="20" colspan="2"><p>Fixed Tel: <?php echo $row_RsSupplierInfo['SupplierFixedTelephoneNumber']; ?><?php echo $row_RsProductProposed['ProductOwnerPhone']; ?></p></td> </tr> <tr bgcolor="#3399FF"> <td height="20" colspan="2"> <form action="" method="get"> <input name="LN" type="hidden" value="<?php echo $row_RsServiceVoucher['CustomerLastName']; ?>"> <input name="RID" type="hidden" id="RID" value="<?php echo $row_RsServiceVoucher['RequestID']; ?>"> <input name="PID" type="hidden" id="PID" value="<?php echo $row_RsServiceVoucher['ProductID']; ?>"> <input name="SupID" type="hidden" id="SupID" value="<?php echo $row_RsServiceVoucher['SupplierID']; ?>"> </form></td> </tr> <!--End--> <tr bgcolor="#3399FF"> <td height="20" colspan=2> <p style="font-family:verdana, arial,sans-serif;font-size:6pt;text-align:center;margin-top:0"> <tr bgcolor="#3399FF"> <td width="153" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"> </td> <td width="424" height="20"> <p style="font-family:verdana, arial,sans-serif;font-size:8pt;text-align:left;margin-top:0"><font face="Arial, Helvetica, sans-serif"></font></p></td> </tr> </table></td> </tr> <tr> <td height="3" bgcolor="#CCCCCC"></td> </tr> <tr> <td height="3" bgcolor="#CCCCCC"></td> </tr> </table> </body> </html> <?php mysql_free_result($RsServiceVoucher); mysql_free_result($RsSupplierInfo); ?> <?php //url vars: $urlRID = $_GET['RID']; $urlSupID = $_GET['SupID']; $urlPID = $_GET['PID']; $urlpar = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; // get url content $url_contents ="http://mysite:mysitebo@$urlpar "; $query_file_content = file_get_contents($url_contents, "r") or die("cannot open url"); // save results to a local file // depending on how your server is configured you may need to give queryfiles folder 777 permission // file rename $filenameSV = 'SV_'; $filenameLN = $_GET['LN']; $filenameRID = $_GET['RID']; $filetype = '.htm'; $file = fopen('../backoffice/createdfiles/'.$filenameSV.''.$filenameLN.'_'.$filenameRID.''.$filetype.'', 'w+'); fwrite ($file, $query_file_content); fclose($file); ?> Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-758001 Share on other sites More sharing options...
dflow Posted April 28, 2009 Author Share Posted April 28, 2009 hi this script is taking too long on my hosting server I get 500 server error the script should show a preview of a form and then save to a folder as a HTML file is the script too complex? or do I need a new dedicated hosting to control server timeouts? Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-821256 Share on other sites More sharing options...
dflow Posted April 29, 2009 Author Share Posted April 29, 2009 bump in the name of knowledge Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-821771 Share on other sites More sharing options...
Mark Baker Posted April 29, 2009 Share Posted April 29, 2009 server problem 500 is nothing to do with timeout (at least not according to any web server that conforms to RFC 2616 408 is a server timeout, 504 a gateway timeout. 500 is most commonly because there is an error in your script that prevents it from running at all, a fatal error. Try doing a php -l against the script to identify the problem... and against any included files as well Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-821976 Share on other sites More sharing options...
Daniel0 Posted April 29, 2009 Share Posted April 29, 2009 server problem 500 is nothing to do with timeout (at least not according to any web server that conforms to RFC 2616 408 is a server timeout, 504 a gateway timeout. If PHP exceeds the max execution time it will result in a fatal error. Fatal errors mean a 500 error when PHP is running as CGI or FastCGI. dflow, check the error logs, they'll say which error caused the 500. Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-822158 Share on other sites More sharing options...
dflow Posted April 30, 2009 Author Share Posted April 30, 2009 hi guys i checked my error logs nothing relating this page ??? Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-822623 Share on other sites More sharing options...
Daniel0 Posted April 30, 2009 Share Posted April 30, 2009 Which log did you check? You need to check PHP's and not Apache's. Also, you need to ensure that error logging is turned on, obviously. Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-822627 Share on other sites More sharing options...
dflow Posted April 30, 2009 Author Share Posted April 30, 2009 error logging is turned on in php.ini i still get no errors Quote Link to comment https://forums.phpfreaks.com/topic/144369-script-processing-time-issues/#findComment-822724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.