SitePoint Sponsor

User Tag List

Results 1 to 20 of 20
  1. #1
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    just getting started

    hi,

    I'm trying to learn php/mysql by this excellent article by Kevin Yank (Building a Database-Driven Web Site Using PHP and MySQL). I installed the package from http://www.firepages.com.au/devindex.htm?from=oldphpdev and have already run into a problem. Where Kevin says to test the first php script that is supposed to return the date of my server, it just shows the html but there's no result of the php code. Apparently my browser still doesn't recognize the php. My apache server is running.

    Thanks for any info

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you used the extension .php and not .htm ? The name of your file will be something like file.php

    You need to use this extension to tell Apache that the file contains PHP code.

    Sean

  3. #3
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    yes, it's .php

    yeah, i used the php.extension
    it's only the apache server that has to be running right? and the php file is just on my desktop (not on a remote server).
    it said somewhere on http://www.firepages.com.au/devindex.htm?from=oldphpdev that i should be "on my way" when i enter http://localhost in my browser, but that just gives an error message.

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right, there should be a folder in your apache folder called htdocs. This is where you put all of your files. Create a file called info.php and put the following inside it :
    PHP Code:
    <?php

    phpinfo
    ();

    ?>
    Save the file in your htdocs directory and then open your browser and go to http://localhost/info.php

    All should be fine!

    Sean

  5. #5
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hmm

    thanks for your help sean, but sorry to have to keep nagging
    there's no htdocs in my apache folder. i tried to create one and did as you said but i get the same error in my brwoser (A problem occured on the origin server - HTTP error 500 - bad url)

  6. #6
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have not used firepages, but there should be a folder that you store your files in. In the file apache file httpd.conf there should be a setting called DocumentRoot which will look like "c:/apache/htdocs" This will tell you where you need to place your files.

    Sean

  7. #7
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hmmm2

    aargh, still the same thing
    found the file, copied to that directory, but same thing in the browser

  8. #8
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could uninstall firepages and try another package. The one I use is PHPTriad from www.phpgeek.com

    Sean

  9. #9
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    when I installed firepages the default location for the root of the webserver was something like C:/phpdev3/www/ - where C:/phpdev3 was the directory I'd extracted everything to. So the root wasn't actually under the apache folder at all.

    Have a look to see if there's a www folder at the same level as the apache folder - if so try the file in there, still using http://localhost/ to access it.

  10. #10
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    www

    yes, i just found out about the www folder and put the document in there, but still the same result.
    can somebody tell me the things that I should check? (ini files etc)
    thx

  11. #11
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Go to: http://localhost/

    Do you get an error?

  12. #12
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, that gives an error
    i just found out:
    i have to enter http://127.0.0.1. Someone told me windows doesn't recognize "localhost" by default. now it works.
    thanks for everyone's input. I'll be back with more questions later, undoubtedly :-)

  13. #13
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Windows should recognize it by default, if not then click:

    Start > Find > Files or Folder > Search for 'Hosts'

    You should find:

    Hosts.sam
    LMHosts.sam

    Rename Hosts.sam to Hosts
    Edit, and delete everything inside. Then enter:

    localhost 127.0.0.1

    Save and then localhost should work.

  14. #14
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, that works
    (had to config explorer not to use a proxy though)
    Now i'm trying to get this myadmin to work. It says
    Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: NO) in C:\apache\htdocs\phpmyadmin\lib.inc.php on line 255
    Error

  15. #15
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you started MySQL ? This is a seperate program to Apache. You might have a program called MySQL Admin or WinMySQLAdmin, starting this program will start MySQL and then you can use it to shut it down.

    Sean

  16. #16
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi again :-)
    yes, mysql is running. i'm able to query the database in the mysql dos window.

  17. #17
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you need to use a password for MySQL you have to change the config.inc file for PHPMyAdmin. Look for $cfgServers[1]['password'] = '';

    Sean

  18. #18
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i set a pwd there. can you tell me where i need to enter it now?

  19. #19
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Belgium
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    never mind. it works! thx!
    it doesn't on my remote f2s.com server though. there i still get a similar error. does this also have to do with local settings on my machine?

  20. #20
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you have put your MySQL password there it should work now. Is this line set in the config.inc file ? $cfgServerDefault = 1;

    Sean


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
  •