Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
注意: 我在 Linux 上使用 apache2 和 PHP 5
假设我有这个简单的 hello_world.php 文件:
<html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World </p>'; ?> </body> </html>
...我想在我的apache2服务器上显示它。我该怎么做,我在哪里移动源代码?先感谢您
您必须将文件移动到 /var/www 并确保 Apache 已启动。
在终端中运行以下命令:sudo /etc/init.d/apache start
启动浏览器(例如:Chrome)并在 url 地址栏中输入“localhost/hello_world.php”。