SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Book: Build your own Database Driven ... 4th Edition - By Kevin Yank

    Hi everybody,

    I have bought this book about 8 months ago and this week I started focus study it.

    I have a very simple problem but have no skills yet to get along.

    I installed: MySql, Apache and then Php

    When loading the local page http://localhost/ I do see the It works! page just fine.

    At this point I believe everything was properly installed.

    After I wrote my first .Php file and called from the severside it's show the code instead "Today's date!"... However, after upload the same file in my web-host the server date showed just fine as you can see @ http://www.allaboutlawncare.net/today.php

    My question will be: Why I see the .Php code instead the date from my local server?

    I'm a new .Php user... I have a few a little bit of knowledge on .Php but would like to improve with this book as well MySql skills.

    Much appreciate any help.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Hi rcbarros. Welcome to the forums.

    What actual URL are you using on your local machine? If you look at page 51, it notes a few things about the localhost URL:

    type http://localhost/today.php or http://localhost:port/today.php if Apache is confugured to run on a port other than the default of 80

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    71 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rcbarros View Post
    Why I see the .Php code instead the date from my local server?
    It sounds like you havent configured apache to interpret .php files with the PHP engine....

    You should never see the plaintext PHP code when visiting a page.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  4. #4
    SitePoint Member
    Join Date
    May 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Hi rcbarros. Welcome to the forums.

    What actual URL are you using on your local machine? If you look at page 51, it notes a few things about the localhost URL:
    I open my browse and type: http://localhost:8080/today.php and automatically show the script code instead today's date.

    The It works! page it's working just fine because its clear there are not .php code into it plus it's a .html file

    I have follow all the steps exactly as show in the book with especial attention in forward slashes.

    StarLion says "It sounds like you havent configured apache to interpret .php files"

    How to ensure I have done this properly? Is there any other steps not noted in the book?

    Means while thanks for your help guys... I just want to make work in my local machine... I'm pretty sure will be a better understand for the future.

  5. #5
    SitePoint Member
    Join Date
    May 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just figure out the solution

    The book page 18-19 says "... All you need to do is add the following lines to the very end of the file"

    LoadModule...
    AddType ...

    This is not right... Those lines can not be enter in the very end of the file but in different part of the file such as:

    LoadModule ... after the last line of the loadmodule section
    AddType ... before the closing </IfModule> for mime_module


    If following the book... the Apache will never interpret .php files.

    Another major point that the book didn't make any comment was about copy all .dll files at the root of your php directory into your system32 directory except those that is using php5*.dll

    I hope this threads be alive for a while... Pretty sure will help others.

    Thanks guys for your help!

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Glad you found a solution! Thanks for reporting it back. I'm sure the thread will help others.


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
  •