Find the answer to your Linux question:
Results 1 to 2 of 2
so I just installed everything to run PHP, and I started with the Hello World tut. I pasted Code: <html> <body> <?php echo "Hello World"; ?> </body> </html> to a ...
  1. #1
    Just Joined!
    Join Date
    Aug 2005
    Posts
    54

    PHP newbie

    so I just installed everything to run PHP, and I started with the Hello World tut.

    I pasted
    Code:
    <html>
    <body>
    
    <?php
    echo "Hello World";
    ?>
    
    </body>
    </html>
    to a kate and saved it test.php on desktop
    when I opened it, it asked me to either open it (with kate) or save it (as if I am downloading the page)

    on the other hand, if I made a php file and put it in /var/www/
    it works perfectly.

    my question: should it only work in /var/www/ ??? is it normal like this?
    if not , why is this happening?

  2. #2
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    The web server only processes pages from its web document root (/var/www in this case). To get scripts to run from another location, you can either change the document root in Apache's config file or make a directory where you want to write web documents and symlink it to a sopt in /var/www.
    Stand up and be counted as a Linux user!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...