简体   繁体   English

如何从Web服务器运行php脚本

[英]How to run php scripts from web server

I've started to learn about dynamic web pages so I dont know much about web servers or php or anything that's related to web. 我已经开始学习动态网页,因此我对Web服务器或php或与Web相关的任何东西都不了解。 So I've installed XAMPP (to opt/lampp as default),and I want to test my first ever php script, but I don't know where to save it, because if I save it simply in opt/lampp it says object now found in the browser. 所以我已经安装了XAMPP(默认为opt / lampp),并且我想测试我的第一个php脚本,但是我不知道将其保存在哪里,因为如果我将其简单地保存在opt / lampp中,它表示对象现在可以在浏览器中找到。 在此处输入图片说明 Where do I need to save my php scripts in the server to be able to run them in the browser? 我需要在哪里将php脚本保存在服务器中才能在浏览器中运行它们? Thank. 谢谢。

You should save them under www/ 您应该将它们保存在www/

Example under www/ you have a file called test.php the correct url should be localhost/test.php 在www /下的示例,您有一个名为test.php的文件,正确的URL应该是localhost/test.php

Another under www/ you have a folder called test_folder that contains a file called my1script.php 在www /下的另一个文件夹中有一个名为test_folder的文件夹,其中包含一个名为my1script.php的文件

the correct url should be localhost/test_folder/my1script.php 正确的网址应为localhost/test_folder/my1script.php

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

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