2011-08-10 28 views
0

ex1.phpPHP ..不工作在Mac上,當我在文件上單擊

**代碼中

<?php 
    echo "hello world"; 
?> 

我也試過這個(ex2.html):

<html> 
<head> 
<title>A PHP script</title> 
</head> 
<body> 
<b> 
<?php 
    echo "hello world"; 
?> 
</b> 
</body> 
</html> 

在此先感謝

+1

這裏是一個[有用的鏈接](http://blog-en.mamp.info/2009/02/screencast-mamp-installation.html) – Ibu

回答

3

您需要從網絡服務器運行

http://localhost/ex1.php #or whatever the path is. 

或者在命令行上如果PHP安裝在CLI您

php ex1.php 

訪問this site來看看如何在你的Mac和它是如何工作安裝MAMP。

+0

當我從服務器運行ex1.php ...只有代碼顯示出來。 – jdl

+0

當我從服務器運行ex2.html時......沒有顯示 – jdl

+0

你是如何從服務器上運行它的?什麼是網址? – Ibu