如何使PHP内置网络服务器访问子目录?
我一直在尝试使PHP内置网络服务器阅读子目录。我的文件结构是网站 - > HTML,CSS,PHP。我使用php -s localhost:8000
将网站文件夹设置为根。 PHP内置网络服务器无法读取此目录。浏览器中的错误是404不喜欢该服务器上所请求的资源 /。终端中的错误是[get] / -no这样的文件或目录< / code>。 Web服务器找不到HTML文件夹内部的index.html文件。我在做什么错?
I have been trying to get the php built-in webserver to read sub directories. My file structure is website --> html, css, php. I set the website folder as the root using php -S localhost:8000
. The php built-in webserver cannot read past this directory. The error in the browser is 404 not fond The requested resource / was not found on this server. The error in the terminal is [GET] / -No such file or directory
. The webserver cannot find the index.html file that is inside of the html folder. What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请在您在Stackoverflow上发布之前尝试探索问题...
您的答案是Google单击几下:“ php内置的Web服务器”搜索在Google上将返回以下内容: https://www.php.net/manual/manual/en/features.commandline.webserver.php 作为第一个命中,它在3D段落上非常清楚地指出:
我实际上是在首先提到的警告!
Please try and explore the problem before you post on stackoverflow...
Your answer was a google few clicks away : "php built in web server" search on google will return this : https://www.php.net/manual/en/features.commandline.webserver.php as the first hit which states very clearly on the 3d paragraph that:
I would actually refer to the warning at the top first!