Php 自定义购物车上的间歇性服务不可用错误
我正在建造一个购物车,现在我正在研究产品的分类系统。我必须从管理面板中添加类别,这很好 现在,当我想更新类别时,页面会继续加载,3-4分钟后,它会显示mozilla firefox中的服务暂时不可用错误和chrome中的404错误 当联系到托管提供商时,以下是他在邮件中发送的内容:Php 自定义购物车上的间歇性服务不可用错误,php,apache,http-status-code-503,Php,Apache,Http Status Code 503,我正在建造一个购物车,现在我正在研究产品的分类系统。我必须从管理面板中添加类别,这很好 现在,当我想更新类别时,页面会继续加载,3-4分钟后,它会显示mozilla firefox中的服务暂时不可用错误和chrome中的404错误 当联系到托管提供商时,以下是他在邮件中发送的内容: The issue that you are facing is mainly due to saturation of the number of fcgi processes allocated for your
The issue that you are facing is mainly due to saturation of the number of fcgi processes allocated for your account. We allow 3 child process and for each child process, 256 worker processes. Once that limit is breached, you see that kind of error. However, those errors are auto-fixed once the number of processes reduce.
--
[Thu Feb 19 08:29:30 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
[Thu Feb 19 08:29:31 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
[Thu Feb 19 08:29:32 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
[Thu Feb 19 08:29:32 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
[Thu Feb 19 08:29:32 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
[Thu Feb 19 08:29:33 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
[Thu Feb 19 08:29:33 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
[Thu Feb 19 08:29:33 2015] [warn] [client My-IP-Address] mod_fcgid: can't apply process slot for /usr/local/cpanel/cgi-sys/php-fcgi, referer: http://www.example.com/nbs/Administrators/Categories/
--
In order to fix the issue permanently, you need to optimize your codes or please go for VPS packages.
下面是categories文件夹的php code index.php页面
<form method="POST" action="http://www.example.com/nbs/ActionFiles/DeleteSelectedCategories.php">
<div class="table-responsive">
<table border="1" class="table table-bordered table-striped">
<thead>
<tr>
<th class="text-center"><input type="checkbox" id="all" name="deleteCat[]"></th>
<th class="text-center">Category-Name</th>
<th class="text-center">Action</th>
</tr>
<tr>
<th> </th>
<th>
<input class="filter form-control input-sm" name="Cat-Name" placeholder="Cat-Name" data-col="Category-Name">
</th>
<th> </th>
</tr>
</thead>
<tbody>
<?php
require_once '../../Classes/class.Validation.php';
$validate = new Validation();
$qu = "SELECT CatId, CatName FROM categories";
$validate->Query($qu);
if ($validate->NumRows()) {
while ( $row = $validate->FetchAllDatas() ) {
echo '<tr>
<td class="text-center"><input type="checkbox" id="'.$row["CatId"].'" value="'.$row["CatId"].'" name="deleteCat[]"></td>
<td>'.$row['CatName'].'</td>
<td>
<a href="http://www.example.com/nbs/Administrators/Categories/UpdateCategory.php?id='.$row["CatId"].'">UPDATE</a><br /><a href="http://www.example.com/nbs/ActionFiles/DeleteCategory.php?id='.$row["CatId"].'">DELETE</a>
</td></tr>';
}
}
?>
</tbody>
<tfoot>
<th class="text-center"><input type="checkbox" id="all" name="deleteCat[]"></th>
<th class="text-center">Category-Name</th>
<th class="text-center">Action</th>
</tfoot>
</table>
</div>
<input type="submit" id="del" name="btnCatDelete" value="DELETE" class="btn btn-link pull-right">
</form>
请告诉我哪里出了错。提前谢谢
编辑1:UpdateCategory.php
<?php
session_start();
if (!isset($_SESSION['Administrator']) && $_SESSION['Administrator'] == "") {
header("Location: http://www.example.com/nbs/Administrators/");
exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Benefit Sqaure Administrator - Add Products</title>
<link href="http://www.example.com/nbs/BootStrap/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<link href="http://www.example.com/nbs/StyleSheets/toastr.css" type="text/css" rel="stylesheet" />
<link href="http://www.example.com/nbs/StyleSheets/styles.css" type="text/css" rel="stylesheet" />
<link href="http://www.example.com/nbs/Images/bs-favicon.png" rel="icon" type="image/x-icon" />
<script src="http://www.example.com/nbs/JavaScripts/Modernizr.js"></script>
</head>
<body style="margin-top: 75px;">
<?php
require_once '../../PHP_Includes/AdminNavs.php';
require_once '../../Classes/class.Validation.php';
$validate = new Validation();
$catName = $catAvail = $catDesc = $catParent = "";
$catSeoUrl = $catMetaTitle = $catMetaDesc = $catMetaKeyWords = "";
$catTaxPercent = "";
$error = 0;
if (isset($_GET['id']) && $_GET['id'] != "") {
$q = "SELECT * FROM categories WHERE CatId = '".$_GET['id']."' ";
$validate->Query($q);
if ($validate->NumRows()) {
while ($row = $validate->FetchAllDatas()) {
$catName = $row['CatName'];
$catDesc = $row['CatDescription'];
$catParent = $row['CatParentId'];
$catAvail = $row['CatDisplay'];
$catSeoUrl = $row['CatSeoUrl'];
$catMetaTitle = $row['CatMetaTitle'];
$catMetaDesc = $row['CatMetaDescription'];
$catMetaKeyWords = $row['CatMetaKeyWords'];
$catTaxPercent = $row['CatTaxPercent'];
}
}
}
?>
<div class="container-fluid">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active">
<a href="#general" data-toggle="tab">General</a>
</li>
<li>
<a href="#marketing" data-toggle="tab">Marketing</a>
</li>
<li>
<a href="#account" data-toggle="tab">Accounts</a>
</li>
</ul>
<div class="tab-content" style="margin-top: 25px;">
<div class="container-fluid tab-pane active" id="general">
<div class="panel panel-primary">
<div class="panel-heading">
<h4 class="text-center">Update Product Details</h4>
</div>
<div class="panel-body">
<form class="form-horizontal" action="http://www.example.com/nbs/ActionFiles/UpdateCategories.php?id=<?php echo $_GET['id']; ?>" method="POST">
<div class="form-group">
<div class="col-md-2">
<label id="prodName" for="productName">Category Name:</label>
</div>
<div class="col-md-8">
<input type="text" name="updCatName" value="<?php echo $catName; ?>" class="form-control input-sm" id="productName" />
</div>
<div class="col-md-2">
<span class="glyphicon glyphicon-question-sign" style="margin-top: 5px;" data-toggle="tooltip" data-placement="right" title="The name of the category that you want to be displayed. It should contain only letters"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<label id="prodAvail" for="productAvailability">Parent Category:</label>
</div>
<div class="col-md-8">
<select name="updCatParent" class="form-control input-sm" id="productAvailability">
<?php
$name = "";
$query = "SELECT CatName, CatParentId FROM categories WHERE CatParentId = '".$catParent."'";
$validate->Query($query);
while ($row = $validate->FetchAllDatas()) {
if ($row['CatParentId'] == 0) {
$name = "Parent Category";
} else {
$que = "SELECT c.CatName, cn.CatParentId FROM categories c, categories cn WHERE cn.CatParentId = c.CatId AND cn.CatParentId = '".$catParent."'";
$validate->Query($que);
$name = $validate->FetchAssoc('CatName');
}
}
?>
<option value="<?php echo $catParent; ?>"><?php echo $name . " -- selected"; ?></option>
<?php
$query = "SELECT CatId, CatName FROM categories ORDER BY CatName";
$validate->Query($query);
while ($row = $validate->FetchAllDatas()) {
echo '<option value="'.$row['CatId'].'">'.$row['CatName'].'</option>';
}
?>
</select>
</div>
<div class="col-md-2">
<span class="glyphicon glyphicon-question-sign" style="margin-top: 5px;" data-toggle="tooltip" data-placement="right" title="The availability of the category for the users"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<label id="prodAvail" for="productAvailability">Category Availability:</label>
</div>
<div class="col-md-8">
<select name="updCatAvail" class="form-control input-sm" id="productAvailability">
<option value="<?php echo $catAvail; ?>"><?php echo $catAvail . " -- selected"; ?></option>
<option value="-1">Select Category Availability</option>
<option value="Enabled">Enabled</option>
<option value="Disabled">Disabled</option>
</select>
</div>
<div class="col-md-2">
<span class="glyphicon glyphicon-question-sign" style="margin-top: 5px;" data-toggle="tooltip" data-placement="right" title="The availability of the category for the users"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-2">
<label for="productDes">Category Description</label>
</div>
<div class="col-md-8">
<textarea name="catDescription" id="productDes"><?php echo $catDesc; ?></textarea>
</div>
<div class="col-md-2">
<span class="glyphicon glyphicon-question-sign" style="margin-top: 5px;" data-toggle="tooltip" data-placement="right" title="The description of the category for the users"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="submit" name="btnUpdGenTabCate" id="btnUpdGenTabCate" value="Update Product" class="form-control input-lg btn btn-block btn-primary prdBtnSubmit">
</div>
<div class="col-md-2"></div>
</div>
</form>
</div>
</div>
</div>
<div class="container-fluid tab-pane" id="marketing" style="margin-top: 25px;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="text-center">Enter Marketing Details</h4>
</div>
<div class="panel-body">
<form class="form-horizontal" action="http://www.example.com/nbs/ActionFiles/UpdateCategoriesMkt.php?id=<?php echo $_GET['id']; ?>" method="POST" >
<div class="form-group">
<div class="col-md-2">
<label for="seoURL">SEO URL:</label>
</div>
<div class="col-md-8">
<input type="text" name="catSeoUrl" id="seoURL" class="form-control input-sm" value="<?php echo $catSeoUrl; ?>" />
</div>
<div class="col-md-2"></div>
</div>
<div class="form-group">
<div class="col-md-2">
<label for="metTitle">Meta Title:</label>
</div>
<div class="col-md-8">
<input type="text" name="catMetaTitle" id="metTitle" class="form-control input-sm" value="<?php echo $catMetaTitle; ?>"/>
</div>
<div class="col-md-2"></div>
</div>
<div class="form-group">
<div class="col-md-2">
<label for="metDesc">Meta Description:</label>
</div>
<div class="col-md-8">
<textarea name="catMetaDescription" id="metDesc" class="form-control input-sm" ><?php echo $catMetaDesc; ?></textarea>
</div>
<div class="col-md-2"></div>
</div>
<div class="form-group">
<div class="col-md-2">
<label for="metKeyWords">Meta Keywords:</label>
</div>
<div class="col-md-8">
<input type="text" name="catMetaKeyWords" id="metKeyWords" class="form-control input-sm" value="<?php echo $catMetaKeyWords; ?>" />
</div>
<div class="col-md-2"></div>
</div>
<div class="form-group">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="submit" name="btnCatMrktgTabUpdate" value="Update Marketing" class="btn btn-primary btn-block">
</div>
<div class="col-md-2"></div>
</div>
</form>
</div>
</div>
</div>
<div class="container-fluid tab-pane" id="account" style="margin-top: 25px;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="text-center">Enter Commission Details</h4>
</div>
<div class="panel-body">
<form method="POST" class="form-horizontal" action="http://www.example.com/nbs/ActionFiles/UpdateCategoriesTax.php?id=<?php echo $_GET['id']; ?>" >
<div class="form-group">
<div class="col-md-2">
<label for="modCommission">Tax Percentage:</label>
</div>
<div class="col-md-8">
<input type="text" name="catTaxPercent" id="modCommission" class="form-control input-sm" value="<?php echo $catTaxPercent; ?>" />
</div>
<div class="col-md-2"></div>
</div>
<div class="form-group">
<div class="col-md-2"></div>
<div class="col-md-8">
<input type="submit" name="btnUCommTabUpdate" value="Update Commission" class="btn btn-primary btn-block">
</div>
<div class="col-md-2"></div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Include all the JavaScript File(s) -->
<script src="http://www.example.com/nbs/JavaScripts/jquery-latest.min.js"></script>
<script src="http://www.example.com/nbs/JavaScripts/toastr.min.js"></script>
<script src="http://www.example.com/nbs/JavaScripts/Main.js"></script>
<script src="http://www.example.com/nbs/JavaScripts/multifilter.min.js"></script>
<script src="http://www.example.com/nbs/BootStrap/js/bootstrap.min.js"></script>
<script src="http://www.example.com/nbs/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
CKEDITOR.replace('productDes');
</script>
</body>
</html>
嗯,当托管公司对服务器上的资源设置硬限制时,就会发生这种情况。在这种情况下,您需要更改主机提供商
不管怎么说,您的查询返回了多少行?请帮帮我,伙计们……到目前为止,只有20行同时包含了父母和孩子,我想20行应该可以。我想问题出在别的地方了。你能评论一下这个查询并从代码中循环一段时间并检查问题是否仍然存在吗?关于你的信息,我只能从前端管理面板更新父类别,而不是子类别。我的意思是,问题可能不在你提供的代码部分。这是类别的索引页。我必须选择其中任何一个进行更新。错误只出现在索引页上。UpdateCategory.php根本无法加载子类别,而对于父类别,可以加载。