PDA

View Full Version : iThe Internet!



SirCrono6
01-18-2004, 10:15 PM
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

:D

sean
01-18-2004, 10:33 PM
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.

Jeremy G
01-18-2004, 10:44 PM
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.


<?php

// this is a function
function add($a, $b) {
return $a+$b;
}

$aVariable = add(93,7);
echo "The answer is " . $aVariable;
?>


have fun.

major_small
01-18-2004, 11:32 PM
yeah... PHP is similar to HTML... all the pages need is to be on a server that can parse PHP...

Leeman_s
01-19-2004, 10:37 PM
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.

linuxdude
01-19-2004, 11:00 PM
^
:)

glUser3f
01-20-2004, 07:22 AM
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
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.

ober
01-20-2004, 07:28 AM
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 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.

glUser3f
01-20-2004, 11:10 AM
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/

SirCrono6
01-20-2004, 05:33 PM
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


# 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/mpm_common.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 :D)

- SirCrono6

Leeman_s
01-20-2004, 06:28 PM
aren't your slashes the wrong way? its windows