Sign in to follow this  
dave

[web] Has Anyone Setup PHP and Apache on their PC?

Recommended Posts

dave    2187
I have everything installed and running, via xampp and for some reason i can't get my php files to be server-processed. Can anyone who has set up this please reply. Dave

Share this post


Link to post
Share on other sites
JohnBSmall    881
I have a combination of Apache, PHP and MySQL set up on two XP machines, although I didn't use xampp. Not much else anyone can say about it until you give us some more information about what your setup is and what you've done so far.

John B

Share this post


Link to post
Share on other sites
dotproduct    180
What's "xampp"?

Anyways, you probably need to have apache load the php module on startup.

If you're running linux, and apache2, this is done by creating a symlink from mods-available/php4* to mods-enabled/php4*.
At least on Debian..

If you're running Apache 1.3, it's done in the config file somewhere..
"LoadModule php4.so" or something like that..

Share this post


Link to post
Share on other sites
jflanglois    1020
I've done it on Windows XP and an LFS (Linux) system.

Without more information, here is what I can suggest:

Make sure the type is registered with Apache (in httpd.conf):
AddType application/x-httpd-php .php

Make sure you've loaded the php cgi/module in httpd.conf

Do not just open your php files in a browser, go through the actual web server (http://localhost or similar) with your php documents in the document root (default Apache Install Dir/htdocs)

[edit] XAMPP. So actually it should be properly set up. I suppose just my last suggestion holds any fluid.


jfl.

Share this post


Link to post
Share on other sites
dave    2187
Yeah, sorry. I thought i wouldn't bother trying to explain it all until someone was capable of answering.

xampp installed everything.

All i know is that somewhere on a different drive i have my website .php file and the script doesn't work.

I'm knew to this so i don't know the basics, can i have php files anywhere on my comp and test them in ie with no extra tassles?

Share this post


Link to post
Share on other sites
jflanglois    1020
No, that's what I meant in my last suggestion. The php files need to be in your server's "document root", and you access them as if your computer were a website, that is, http://localhost/index.php et cetera. With XAMPP, you are supposed to put your php documents in xampp-install-dir/xampp/htdocs (normally)


jfl.

Share this post


Link to post
Share on other sites
Mattman    336
Quote:
Original post by Vyper_uk
I believe you have to have the php files in your webroot, which is configured in the Apache config file

What he said...unless this "xampp" thing you're talking about changes the root folder.

Share this post


Link to post
Share on other sites
dave    2187
Ok i tried it and the page loaded but blank,
this is the code:


<html>
<body>

<php echo Hello World; ?>
</body>
</html>


EDIT: Oh crap i just realised that this is borked php, all working now thanks guys!!

Dave

Share this post


Link to post
Share on other sites
Drew_Benton    1861
That should be:

<html>
<body>

<?php echo 'Hello World'; ?>
</body>
</html>


And it should work out of the box, I just downloaded this to see how it went, and after changing the passwords and stuff, it works great, php and all. Your files go in the 'htdocs' folder. So make a new folder inside that folder and move all that old stuff into the new folder. Then back to the htdocs, make a index.php file with the above code and when you go to http://localhost, you should see it work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this