UbuntuでPHP
PHPでhello, world。
環境はUbuntu12.04。
まずはPHPをインストール。
> sudo apt-get install php5
apacheも入ったようなのでブラウザでhttp://localhost/にアクセス。
It works!と表示された。This is the default web page for this server.
The web server software is running but no content has been added, yet.
[hello.php]
<?phpこのファイルを/var/www/hello.phpに保存。(root権限が必要。)
echo"hello, world";
?>
ブラウザでhttp://localhost/hello.phpにアクセス。
hello, world無事表示された。