SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am starting to learn pHp from the very beginning, I have installed pHp, Apache, and mySQL in my windows 98.

    I wrote the html that will show todays' date using notepad. I have the file saved as .php as well as .html

    My problem is that I can't see any result if I open the html, but I can see the result if I open the .php file.( it shows the result very quick and shut down the .php file by itself)


    I don't think this is the right way to view the file. I supposed the file should be view in .html

    I opened Apache, php when I tried that.

    Please advice.

    Thanks very much.

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Put the PHP file in your root web and type: http://localhost/filename.php into your web browser address bar.
    Wayne Luke
    ------------


  3. #3
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I installed the apache, mySQL and php in drive D.

    I don't understand when do you mean by root web.

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Apache installs a root web. Most likely it will be D:\APACHE\HTDOCS

    That folder will be your Root Web. You can find out more about this in your Apache Documents. You would put all your files in this folder just as if you were putting them on your webserver. Then by using http://localhost/filename.ext you can load the different files. It works just like if you were browsing the Internet just use localhost as your domain name.
    Wayne Luke
    ------------


  5. #5
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THanks, I have found my root web.

    The .php file can be open but with no result shown. I'm testing the short php that to show today's date from web tutorial.

    I wonder if this happened due to the setting of php or apache (httpd.conf file) as all this I've installed in drive D. Maybe I have to change the setting somehow?

  6. #6
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Indeed, you need to configure Apache to use PHP to process .php files before sending them to the Web browser. My tutorial explains how to do this under Linux. Unfortunately, configuring Apache to use PHP under Windows can be quite difficult. For this reason, and because Apache can be comparatively slow under Windows, I tend to recommend Sambar Server for tring out PHP under Windows. See my post here for installation instructions.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  7. #7
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know how to configure in apache or pHp (for my case as stated above) since I have it installed already?

  8. #8
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are going to need to put the following into your httpd.conf file
    #Make this the correct path to your php executable
    ScriptAlias /php/ "C:/Inetpub/scripts/php/"
    AddType application/x-httpd-php .php .php3 .phtml .html .htm
    AddType application/x-httpd-php-source .phps
    Action application/x-httpd-php "/php/php.exe"
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  9. #9
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks everyone,all of you have help me a lot, especially to freddy, You have really answered my question.


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
  •