无法找到带有AJAX请求的PHP文件
Cant find PHP file with AJAX request
我有一个PHP文件,位于:/epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php
其权限为rwxrwxrwx (777)
,所有者为epcvt : users
我想通过从该文件启动的AJAX请求调用runVT.php
文件:/var/www/html/evtgen/evt_run.php
我试着用这个Javascript来称呼它:
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","/epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php" ,true);
xmlhttp.send();
}
但我总是收到一个找不到文件的回复:
The requested URL /epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php was not found on this server.
我也试过
xmlhttp.open("GET","../../../../epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php" ,true);
和
xmlhttp.open("GET","epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php" ,true);
但这也没用。
为了检查文件夹上是否遗漏了什么,我转到Unix中的/var/www/html/evtgen/
文件夹,并检查了两者:
vi /epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php
vi ../../../../epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php
他们俩都工作了(我拿到了剧本文本)。我错过了什么?
在文档根目录(/var/www/html/
)中创建一个文件,根据需要进行调用。
在这个文件中,让它将您的文件称为/epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php
。
示例:
<?php
require_once '/epcusers/toolsamc/users/epcvt/VT/CTM/CTM80/Billing/bin/runVT.php';
任何不在文档根目录中的内容都不能被客户端访问,除非你有一个PHP文件链接它(或者apache重写,但那是另一回事)。
相关文章:
- Ajax POST请求没有'我不了解PHP
- 将phonegap图像发布到php/mysql-图像字段从发布请求中消失
- 通过XHR请求将MYSQL数组从PHP返回到Javascript
- 在PHP中检测AJAX请求来自哪个文件
- PHP处理来自一个页面的http请求,并将其显示在另一个页面上
- 如何根据传入的哈希标签发送PHP请求
- 在同一主机上对PHP文件使用XMLHTTP请求的Javascript违反了同源策略
- 在AJAX发布请求期间,PHP$_POST为空
- Ajax/JSON请求php处理页面
- AJAX请求php获取post/get发送的指定目录中服务器上的文件列表(无JQUERY)
- 通过jQuery和FormData的Ajax POST请求-PHP上的$_POST为空
- 当请求php脚本生成的图像时,如何使用javascript/其他方法以某种格式打印日期
- AJAX请求php脚本
- PJAX在请求PHP文件时不起作用
- 未找到Ajax发布请求php
- 在Curl请求(PHP)中禁用Javascript
- jQuery AJAX请求PHP登录不正常
- AJAX请求php脚本循环
- 不提交请求- PHP, AJAX &Javascript
- JSONP请求PHP页面不工作(跨域)