Where do I put my Hello world PHP file on Ubuntu?

前端 未结 6 864
半阙折子戏
半阙折子戏 2021-02-13 22:04

So I want to learn PHP, and I\'ve installed it with \"sudo apt-get install php5\" on my Ubuntu 14.04 machine. I see it also installed Apache.

Now I\'ve created my progra

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-13 22:45

    Assuming you have php5 and apache2 installed and apache running, here's how to get to script execution quickly.

    create script:

    echo "Hello World

    '; ?>" > /var/www/index.php

    open browser:

    gnome-open http://localhost/index.php
    # or: 
    sensible-browser http://localhost/index.php
    

提交回复
热议问题