SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member ripsnorta's Avatar
    Join Date
    Oct 2004
    Location
    Baltimore MD
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Newbie stumped on PHP installation

    Hi everyone,

    I've had a look through the forums (and have done quite a bit of searching on the web) but haven't found anything to help me yet. So here goes...

    I have installed PHP4.3.9 on Apache 2 under Windows XP. This is on my home computer. The installations seem to have gone well and I followed the instructions to setup the configuration and ini files. At each stage I tested the system. Apache seems to work properly, when I use localhost I get the initial Apache web page.

    I then copy the initial Apache web files to a backup directory and attempt to set up my index.html document which is a simple html page with some images. This also works.

    Following the advice on a lot of webpages I created a page called test.php which contains the text:

    <?php phpinfo(); ?>

    Using the address localhost/test.php brings up a page with all of these environment variables and settings. So far so good.

    Now I try and embed some php code in my index.html document. This is where the troubles begin. It doesn't work.

    If I add the line <?php echo "some text"; ?> I get: some text"; ?> appearing on the page.

    If I remove all the html and include the original <?php phpinfo(); ?> as the only item in the document, I get a blank output. Nothing happens. It's as if the embedded php is not being recognised as a valid script, while the code in the external files is recognised.

    Now, I've tried a few things. I removed and reinstalled a few times. I've been through the configs more times than I count. I initially installed the msi version of the php installer, I then downloaded the zip file version and reinstalled that. I even uninstalled Apache, PHP, and MySQL completely, and downloaded and installed XAMPP which is supposed to do a install tailored for these apps.

    After all this, I am still not able to get an embedded script working. Can anyone tell me what I am doing wrong?

    cheers

    John

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Pennsylvania
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ripsnorta

    Now I try and embed some php code in my index.html document. This is where the troubles begin. It doesn't work.

    Change the index.html file to index.php.

  3. #3
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *.html - Static HTML page. No php functionality at all (by default in apache)
    *.php - PHP file. Includes php functionality.

    Now, you can make .html pages execute php code, but not without fiddling without some .htaccess stuff (or your apache configuration file).
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  4. #4
    SitePoint Member ripsnorta's Avatar
    Join Date
    Oct 2004
    Location
    Baltimore MD
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Boy. Is my face red!

    There, I knew it had to be something simple. Thank you for your help findawebhost and Defender1. Much appreciated.

    cheers

    John


Bookmarks

Posting Permissions

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