简体   繁体   English

WAMP服务器拒绝访问PHP脚本

[英]Access to PHP script being denied by WAMP Server

I have thoroughly checked for an answer to this question but it seems like not one off the countless answers has helped me. 我已经彻底检查了这个问题的答案,但似乎无数答案中没有一个对我有帮助。

I would appreciate some guidance. 我希望得到一些指导。 I have a website that I am accessing remotely via the clients public IP address. 我有一个网站,可以通过客户端的公共IP地址远程访问。 I have installed and configured WAMP Server with Apache 2.4.27. 我已经使用Apache 2.4.27安装并配置了WAMP Server。 The machine is also running PHP 5.6.31. 该机器还运行PHP 5.6.31。

What I am trying to do is allow a tax payer to upload supporting documentation to a folder using a script that I wrote called upload.php . 我正在尝试做的是允许纳税人使用我编写的名为upload.php的脚本将支持文档上传到文件夹。 I have tested the program on my local environment and it works. 我已经在本地环境中测试了该程序,并且可以正常工作。 I should add that the bulk of the code for the website is written in a compiled dBASE executable that resides in the cgi-bin . 我应该补充一点,该网站的大部分代码是用位于cgi-bin中的已编译dBASE可执行文件编写的。

I am able to navigate to the page in which I allow the user to select a file and upload it, but when I click the upload button, I get an error message that states. 我能够导航到允许用户选择文件并上传的页面,但是当我单击“上传”按钮时,出现一条错误消息 ,指出。

You don't have permission to access /upload.php on this server.
Apache/2.4.27 (Win64) PHP/5.6.31 Server at 24.148.115.174 Port 8000

I have configured my virtual host to allow access to the Wamp64/www directory . 我已将虚拟主机配置为允许访问Wamp64 / www目录

I have no idea why this is not working . 我不知道为什么这不起作用 If you need to see the httpd.conf file, let me know. 如果您需要查看httpd.conf文件,请告诉我。 Thank you in advance. 先感谢您。

尝试使用: chmod 777 upload.php也许您的Apache用户无权访问upload.php。

I feel foolish. 我觉得很愚蠢。 My vhost.conf file was still set to VirtualHost *:80. 我的vhost.conf文件仍然设置为VirtualHost *:80。

I changed it to VirtualHost *:8000 我将其更改为VirtualHost *:8000

and that fixed the problem. 这样就解决了问题。 Thank you to everyone for their advice. 谢谢大家的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM