Depending on the port settings of MAMP (Preferences -> Ports) you have to call http://localhost:8888/filename.php (MAMP ports) or http://localhost/filename.php (default ports). The file "filename.php" have to be located in this folder: /Applications/MAMP/htdocs/
发布评论
评论(4)
/Applications/MAMP/htdocs/hello.php
然后会出现在 http://localhost:8888/hello.php
:)
/Applications/MAMP/htdocs/hello.php
Will then appear in http://localhost:8888/hello.php
:)
如果您所做的一切正确,请打开浏览器并输入以下内容:
查看它是否成功打开,然后您就可以打开您的网站了。
另请查看 mamp 的文档,了解如何配置它并运行 php 脚本。
If you have done everything right, open your browser and type this:
to see if it opens successfully and then you can open your sites.
Also check out the mamp's documentation on how to configure it and run php scripts.
将 PHP 文件放入 MAMP 中的 HTDOCs 文件夹中,例如,我们将其命名为 hello_world.php,现在您可以通过以下方式运行它:
http://localhost/hello_world.php
Drop the PHP file into the HTDOCs folder in MAMP, for example let's call it hello_world.php and now you can run it by going to:
http://localhost/hello_world.php
根据 MAMP 的端口设置(首选项 -> 端口),您必须调用 http://localhost:8888/filename.php (MAMP 端口)或 http://localhost/ filename.php(默认端口)。文件“filename.php”必须位于此文件夹中:/Applications/MAMP/htdocs/
Depending on the port settings of MAMP (Preferences -> Ports) you have to call
http://localhost:8888/filename.php
(MAMP ports) orhttp://localhost/filename.php
(default ports). The file "filename.php" have to be located in this folder: /Applications/MAMP/htdocs/