我在DigitalOcean上有2GB VPS,我在Debian 7下使用NGINX,php-fpm和unix socket托管WordPress 3.9.1.
它一直工作到上周它开始显示"502坏网关"错误.我检查了日志,发现:
php5-fpm日志显示pm.max_children已达到,nginx日志显示如下:
[错误] 3239#0:*15188 connect()到unix:/var/run/php5-fpm.sock失败(11:资源暂时不可用),同时连接到上游,客户端:xxx.xxx.xxx.xxx,服务器: my.domain,请求:"POST /xmlrpc.php HTTP/1.0",上游:"fastcgi:// unix:/var/run/php5-fpm.sock:",主机:"xxx.xxx.xxx.xxx"
我用不同的设置手动改变了pm,没有运气.每次更改后我总是重启守护进程.
pm设置是:
pm = dynamic
pm.max_children = 100
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 10
pm.max_requests = 200
Run Code Online (Sandbox Code Playgroud)
www.conf已listen = /var/run/php5-fpm.sock启用.
有类似经历的人吗?
有没有办法让下面的脚本将javascript值传递给href链接的url?
<script type="text/javascript">
function geoPreview(lat,long) {
var elemA = document.getElementById("lat").value;
var elemB = document.getElementById("long").value;
window.location.href = "http://www.gorissen.info/Pierre/maps/googleMapLocation.php?lat=elemA&lon=elemB&setLatLon=Set";
}
</script>
Run Code Online (Sandbox Code Playgroud) 我正在处理以下代码,以便从表单中选择复选框.如果我检查第一个复选框,一切都很好.如果我检查另一个复选框,我在发送bulkcopy表单时会收到"未定义的索引"错误.请记住,我正在使用post方法获取复选框,并且由于表单位置和字段的复杂性,提交按钮位于复选框上方.我需要的是选择多个复选框并将某些值添加到数据库.
<?php //bulkcopy.php
session_start();
if($_SESSION['admin_logged_in'] != true){
header("Location:login.html");
exit();
}
include 'db.php';
$from = mysql_real_escape_string($_GET['from']);
$room = mysql_real_escape_string($_POST['room']);
if(!empty($_POST['id'])) {
foreach($_POST['id'] as $check) {
$id = $check;
$sel = mysql_query("select * from $from where id = '$id' limit 1 ") or die(mysql_error());
while($row = mysql_fetch_array($sel)){
$preview = $row['preview'];
$text = $row['text'];
$title = $row['title'];
$images = $row['images'];
}
$ins = mysql_query("insert into $room (id, preview, text, title, images) values (' ', '$preview', '$text', '$title', '$images') ") or die(mysql_error()); …Run Code Online (Sandbox Code Playgroud) 我正在运行一个网站,我想保护WordPress上传文件夹中的所有PDF文件免受外部访问和热链接.
我已经在使用用户身份验证来保护附加到这些文件的帖子,但用户身份验证不保护PDF文件的直接链接或从搜索引擎索引这些文件.
我宁愿不更改默认上传目录,因为PDF随机文件名超过1000并附加到具有不同日期的各个帖子.
该站点使用Nginx,php5-fpm和MariaDB托管在Debian VPS上.
到目前为止,我测试了以下内容:
site.conf 1
location /wp-content/uploads/ {
location ~* \.(pdf)$ {
valid_referers blocked example.com *.example.com;
if ($invalid_referer) {
return 301 https://example.com/services/login-error.html;
}
}
}
Run Code Online (Sandbox Code Playgroud)
site.conf 2
location /wp-content/uploads/ {
location ~* \.(pdf)$ {
valid_referers blocked example.com *.example.com;
if ($invalid_referer) {
deny all;
return 403;
}
}
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,上述配置都没有按预期工作.它们会阻止外部访问,但它们也会将经过身份验证的用户重定向到403或301错误.
任何帮助或建议将不胜感激.
谢谢.