SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Not showing up

    So I set up PHP on a new computer with windows 7 and followed the today.php script from build your own database driven website...
    here is the code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Today&rsquo;s Date</title>
    <meta http-equiv="content-type"
    content="text/html; charset=utf-8"/>
    </head>
    <body>
    <p>Today&rsquo;s date (according to this web server) is
    <?php

    echo date('1, F dS Y.');

    ?>
    </p>
    </body>
    </html>


    HTML is showing up @ http://localhost/today.php but not PHP.

    What could be the issue?

    Thanks
    Wannabe Brainiac

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,601
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Are you running this code through MAMP / WAMP or some other server? It won't work unless you do that.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I set up the programs individually. Should I unistall and use the WAMP for PC using Windows 7.
    Wannabe Brainiac

  4. #4
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    988
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Word_bird View Post
    I set up the programs individually. Should I unistall and use the WAMP for PC using Windows 7.
    Then it sound like it's not set up correctly. Check the configuration again.

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    would that be just the PHP or all components (MySQL and Apache as well)???
    Wannabe Brainiac

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,601
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Could be any of them, I suspect. It is certainly easier to set everything up in WAMP, but if you want some guidance on setting things up as you have, the free chapters of Kevin's book (I think) cover this topic in detail. You can get the free chapters here:

    http://www.sitepoint.com/books/phpmysql4/

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll give it a go at all three...see what that does...
    Wannabe Brainiac

  8. #8
    SitePoint Addict webaddictz's Avatar
    Join Date
    Feb 2006
    Location
    Netherlands
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Word_bird View Post
    I'll give it a go at all three...see what that does...
    It's not MySQL: that's not responsible for parsing your PHP code, so it's unlikely that's causing an issue. It might be Apache that's not setup properly: you have to make sure Apache will pass the .php requests to PHP. Did you use the Windows Installer package to install PHP, or did you use another way? I'm not that familiar in the Windows environment, but if you tell us how you've installed them, maybe I could help you at least in the right direction. Also, look at PHP docs on installing it for Apache 2 on Windows.
    Yes, I blog, too.

  9. #9
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I uninstalled php and apache still my browser is not reading the php. Apache is reading the html sections of the test scripts but not php. Could it be something in the php.ini or httpd.conf or something else...Please help.

    I have set this on on windows XP before and was able to work with php just fine. I emphasize that I am now using Windows 7 should it make a difference I don't know...And I have downloaded each program MySQL, PHP and APACHE seperately.

    Thanks
    Wannabe Brainiac

  10. #10
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    988
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    It will likely be your httpd.conf are you loading the php module? Are you associating php with .php files?

  11. #11
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have checked and double checked the configuration and I don't see anything off.

    I'm not sure what else to do...

    The total code (html & php) shows in firefox. Only html shows in IE.

    Now sure where I am going wrong here???
    Wannabe Brainiac

  12. #12
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,601
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Did you try out Kevin's sample chapters that I linked to above? They might provide a useful checklist.

  13. #13
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I have the book. This is all I have to help me and these are the steps I have followed thus far but I am not sure where I have gone wrong. One thing though, I did remove apache from my computer in the C drive and uninstalled the program but when I downloaded the program again the httpd.conf was already filled in with the info I have previously entered which to me was kind of weird that it was not a fresh page.
    Wannabe Brainiac


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
  •