iThe Internet!

This is a discussion on iThe Internet! within the A Brief History of Cprogramming.com forums, part of the Community Boards category; iThe Internet! Okay, well anyways. I wanted to play around with PHP etc. so I downloaded MySql, Apache, and PHP. ...

  1. #1
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269

    iThe Internet!

    iThe Internet! Okay, well anyways. I wanted to play around with PHP etc. so I downloaded MySql, Apache, and PHP. I installed them... /* BLA BLA BLA BLA BLA */ Okay, now I'm ready to start. Uh oh! I have no idea what to do! Where do I create my PHP files at?

    - SirCrono6

    P.S. Just in case:

    Compiler: Dev-C++ 4.9.8.0
    OS: Windows ME
    Server: Apache
    Other: MySql / PHP

    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    I'm no expert at this area, but I believe PHP files can either go anywhere, and you just run them like programs, or if this server is hooked up to a domain, whatever as considered the root directory as far as that domain is concerned, is where you'd place PHP files. I'm not entirely sure what you're asking, but I hope that helps.

    edit: The MySQL installation will register itself in the server such that any SQL requests made in PHP will automatically get through to the database. If you have a tutorial or book you're learning PHP from, the example they give you for SQL should also include instructions for you as to where to put your server name, user name and password, etc.. The rest is taken care of by the computer.
    Last edited by sean; 01-18-2004 at 10:36 PM.

  3. #3
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Hop on over to www.dzsoft.com download the free trial of there php editor. I use it, very good. There you can create your php files and view them too. When you click the run tab you will have to locate the php.exe file you installed with the release binaries. After that you are ready to go!

    In html use <?php to start a php area of code, and ?> to end it. Heres an example of some php.
    Code:
    <?php
    
    // this is a function
    function add($a, $b) {
         return $a+$b;
    }
    
    $aVariable = add(93,7);
    echo "The answer is " . $aVariable;
    ?>
    have fun.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    yeah... PHP is similar to HTML... all the pages need is to be on a server that can parse PHP...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  5. #5
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    Step 1: Give the windows me cd to your dog (or your wife)

    Step 2: Proclaim loudly "Bill Gates is the Devil!"

    Step 3: Install your favorite distro of *nix

    Live happily ever after.

  6. #6
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926
    ^

  7. #7
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    go to the directory where you installed Apache, there you'll find a directory called htdocs, create a file with .php extension in this directory, open this file in your favorite text editor, type in some PHP code, like:
    PHP Code:
    <?php
    echo 'Hello World!';
    ?>
    Now open you favorite browser, go to http://127.0.0.1/name.php, if you have Apache running and PHP installed correctly, you'll see Hello World, otherwise you'll either get an error message saying "couldn't connect to 127.0.0.1" or something similar, which means that Apache isn't running, or you'll see the PHP code, which means that PHP isn't installed or isn't configured to work with Apache.
    To run Apache, you'll find something like "start Apache in console" in Apache's group in the start menu, to configure PHP with Apache, read the INSTALL file in Apache's directory.
    When you get everything to work right, get the PHP manual, so you can start learning.

  8. #8
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    You'll need to enable PHP in the Apache server to be able to use it.

    to check it php is enabled, created a file with the following:

    PHP Code:
    <?php phpinfo(); ?>
    Save that in a file called index.php

    Call "127.0.0.1" from a browser.

    If a bunch of information spills onto the screen about PHP, it's working. Otherwise, dig through the php.net site and it will tell you how to configure Apache.

    Also, what version of Apache/PHP are you running? I've recently setup 2 servers to run Apache 2 and PHP 4.3 so I can be of some assistance.

  9. #9
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    Apache may listen to port 8080 instead of 80 if you answered so in the installation so another URL to try is:
    http://127.0.0.1:8080/

  10. #10
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269
    Yeah, I found a good tutorial on it. I'm trying to install Apache but I get the error in the console. I couldn't keep it open to read it. But I noticed it said syntax error on line 57, and that it must be a valid file path:

    httpd.conf
    Code:
    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    #
    # NOTE!  If you intend to place this on an NFS (or otherwise network)
    # mounted filesystem then please read the LockFile documentation (available
    # at <URL:http://httpd.apache.org/docs-2.0/mod....html#lockfile>);
    # you will save yourself a lot of trouble.
    #
    # Do NOT add a slash at the end of the directory path.
    # Line 57, I believe it should be below:
    ServerRoot "C:/Babar/•egimite/PHP @@ServerRoot@@ HTML/Apache2"
    My path for Apache is: C:/Babar/•egimite/PHP & HTML/Apache2
    (In Apache's backward slash land )

    - SirCrono6
    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

  11. #11
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    aren't your slashes the wrong way? its windows

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2 internet connections
    By Erakis in forum Windows Programming
    Replies: 0
    Last Post: 07-01-2009, 08:14 AM
  2. Internet Problems
    By SirCrono6 in forum Tech Board
    Replies: 3
    Last Post: 04-26-2004, 10:47 PM
  3. XP Internet problems
    By Hunter2 in forum Tech Board
    Replies: 9
    Last Post: 09-18-2003, 09:56 PM
  4. Internet Publishing Laws
    By novacain in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-09-2002, 02:19 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21