SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP not working - Build your own database driven web site using PHP & Mysql

    Hi, thanks for your help.

    I've struck early problems setting up PHP according to the book by Kevin Yank. Firstly I installed (separately as recommended) Apache, MySQL and PHP on my XP PC. Apache looks fine (localhost is OK), so does MySQL. When I run the example 'today.php' Windows has a pop up saying 'Do you want to open or save this file?' - even though I've told Windows to open *.php files with Internet Explorer.

    In frustration, I installed WAMP on my other Windows 7 PC - more problems (related?). When I run the 'today.php' example it doesn't return a date from the PHP script (....<?php echo date('l, dS Y.'); ?>...), it's just blank where the date should be. Also, when I run Welcome1.html and click the link 'Hi, I'm Kevin' to open Welcome1.php I just get a blank page, even though the address bar says 'file:///C:/wamp/bin/apache/Apache2.2.21/htdocs/welcome1.php?name=Kevin'.

    About 18 months ago I was able to follow the book (on my XP machine) past this early point without any issues (today.php worked OK then) - has Windows blocked something?

    Thanks in advance.
    Last edited by Dom71; Dec 29, 2011 at 23:06. Reason: Typos

  2. #2
    Founder of Primal Skill Ltd. feketegy's Avatar
    Join Date
    Aug 2006
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your loading the php file directly in your browser, hence the 'file://...'

    You need to load it through Apache, just type http://localhost in your browser and see if a directory / file listing comes up (this is called the document root). If you don't see your PHP file in the list, then you must copy the file into that directory, then click on it to load it through Apache, which can load the PHP module to parse the file and get you what you need.

  3. #3
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks feketegy, I feared it was something basic. Cheers.


Tags for this Thread

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
  •