Forum Moderators: phranque

Message Too Old, No Replies

Easy question for the experts re: Apache Install

php apache install problems xp

         

bjh5000

11:52 pm on Feb 20, 2005 (gmt 0)

10+ Year Member



I'm trying to install Apache on Windows XP to learn PHP and MySQL. Honestly I think the install went well for the most part. However, when I type [localhost...] into my browser it says Internet Explorer cannot download the file! Similarly, when I try to access the phpinfo.php file that the book told me to create in http:.//localhost/, it lets me download it but will not display it in the browser like it should.

I'm truly a novice, can anyone help? I'm trying to get my first assignment done, and this isn't helping!

Thanks!
Brian

coopster

12:02 pm on Feb 22, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, bjh5000.

There are a couple of threads in the PHP Server Side Scripting Forum Library [webmasterworld.com] with step-by-step instructions for installing [webmasterworld.com] Apache and PHP5 on Windows. Perhaps they will get you through the installation effectively.

claus

12:20 pm on Feb 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You've got to start the Apache server before it will display anything on localhost. It's not enough to install it.

Look through your documentation for the preferred starting method.

Here's a recent thread about using apache and php on Windows XP [webmasterworld.com] - perhaps there's something helpful in it.

Oh, and welcome to WebmasterWorld :)

bjh5000

5:37 pm on Feb 22, 2005 (gmt 0)

10+ Year Member



Thanks guys, I actually gave up and used xampp to do the install for me. Seems to work well.

I was aware that I needed to start the Apache, that wasn't the problem.

Anyways, thanks for the help guys.

I have another question if anyone can help... I am basically doing this to run a test server. I have a backup of a website I want to use as a starting point. I figured out easily how to recreate the database (MySQL) using the text file backup. Now I have a .tar file of the actual site content (PHP, HTML). I opened it with winzip, but now where does it (site content) go? htdocs? How do I tell it where the MySQL info is. It is 2 main folders (var and home).

If you can help or point me to online help/instructions that would be great!

Sorry again for being such a novice, but I am not just tinkering. I am committed to becoming a webmaster!

claus

5:58 pm on Feb 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> but now where does it (site content) go? htdocs?

Yep, exactly, make a subfolder in /htdocs/, say: /htdocs/testsite/

In that folder, extract the packaged file with the two subfolders. Like this:

a) /htdocs/testsite/var/
b) /htdocs/testsite/home/

The root of your website will probably be in the /home/ folder. In your browser, the path (b) above should be:

[localhost...]

As for MySql, this will probably be written into the php files. You will need to look for something like this:

mysql_connect("localhost","username","password")

In the php files "localhost" might be some path but it should be localhost on your machine. The username on your machine will probably be "root" unless you have chosen another. Password could be anything, including "" (blank).

bjh5000

3:38 am on Feb 24, 2005 (gmt 0)

10+ Year Member



Thanks for the advice. Now that I know where my homepage should appear, I have new problems.

It seems like there isn't much under the /home/ folder, but the bulk of the site exists under var/www/html/ and var/www/html/en/

Does this sound normal?

I'm getting 500 Internal server error. On any php files that I point to.

Any ideas?

To be more specific... when editing the PHP files:

if it lists a reference to [sitename.com...] should I change it to [localhost...] In which cases can I just put /en/images instead (I noticed it is done this way in several places already).

Thanks to anyone who can help!
Brian

claus

7:35 am on Feb 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> Does this sound normal?

Yes it does. The only reason i suggested /home/ was because i didn't know your folder structure, ie. "var" is shorthand for "various", so it could be anything. I think it's safe to assume that what lies in a /www/ folder is supposed to be web content :)

As for your path names: Yes you should change those to point to localhost in stead.

A server error 500 could be because the php script is looking for some module to include, but it can't find it on the path that is specified in the code, so double-checking paths is always a thing you need to do.

bjh5000

6:18 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



I checked the error log, and it said there was a problem in the htaccess file. A command (Rewrite) was giving it an error.

So I commented out these commands, and I no longer get the 500 server error page. I now get this error:

Fatal error: Cannot redeclare database::get_single_column() in C:\apachefriends\xampp\htdocs\ENDEV\var\www\html\en\include\database.class.php on line 191

Because these files are an exact copy of a working site, I think it is still a configuration problem. The database is in this folder C:\apachefriends\xampp\mysql\data\

Again, any help has been appreciated. I am also doing some reading on this but I really want to get this site up to tinker with (even with errors).

claus

10:21 pm on Feb 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> Cannot redeclare database::get_single_column()

The statement on line 191 of the include file is probably a repetition of a statement that has already been issued somewhere else in the code, ie. it's related to this function: "database::get_single_column()"

Perhaps the fix is as easy as commenting it out by putting a # in front of it, but i'm not that much of an expert on MySql - perhaps others can help here?

Otherwise, this search [google.com] might give you something helpful.

bjh5000

9:02 pm on Feb 25, 2005 (gmt 0)

10+ Year Member



Thanks so much, commenting this out made something resembling a webpage finally show on the mainpage! It's riddled with errors but I'm still excited. I'm working on the new problems, and I don't yet know which will stump me and which won't.

Your assistance (claus in particular) is truly appreciated!

The challenge now is that the site is dynamic, but makes itself appear to have distinct html pages. I don't even know what this means, but someone who knows better told me it is true. It makes the whole thing a bit strange to someone new like me... oh well.

I'll try my books and such to see how helpful they can be. First on the list is to find out what exactly "href=" means and does.

thanks!

claus

8:49 am on Feb 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> First on the list is to find out what exactly "href=" means and does.

ROFL :) Surely you don't mean that you're working through advanced subjects like PHP and MySql without having done basic HTML first? That's just like going straight to interior decorating without having built the house - or, actually it's more like installing the HVAC, plumbing, and electricity before the house is built.

Anyway, if it's the case, your PHP book won't tell you that. You will need a basic HTML book/tutorial in stead. It means "Hypertext REFerence" as far as i know, but that doesn't really matter, it's just a code stating that a link starts here.

If you're not joking, you should really search the web for "HTML tutorials", "learn html" or something like that - there's plenty of real good ones out there. It's way easier than PHP so you'll learn the basics in a day or so, but you will get very confused working with PHP without knowing it, as it's just something that's assumed to be known, so they won't explain these things in the PHP book.

bjh5000

5:28 am on Feb 27, 2005 (gmt 0)

10+ Year Member



No joke, but don't worry I am doing HTML first. The site I am trying to run on the test environment is a site I paid to have made 3 years ago. I want to be able to manipulate it for learning purposes. My number one goal is to fully understand my existing site in order to update it and make changes in the future. It gives me a meaningful real-world example that I care about to use along the way. This way I can see how what I am learning makes the site work. Actually making modifications to the real site is a VERY long-term goal. I need to get literate in HTML, PHP, MySQL, Apache, and server configuration.

I never do things the normal way, and it always works out. It's just the way I am. Thanks for your concern though! I know how little I know, and that's the first step.

claus

10:40 am on Feb 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> It gives me a meaningful real-world example that I care about to use along the way.
>> This way I can see how what I am learning makes the site work.

Nothing beats that - that's about the best kind of motivation :)

You should take a look at these forums too, if you haven't been there already:

New to Web Development [webmasterworld.com]
PHP Server Side Scripting [webmasterworld.com]
Website Technology Issues [webmasterworld.com]

HTML-related:

HTML and Browsers [webmasterworld.com]
Javascript [webmasterworld.com]
CSS [webmasterworld.com]

There are always a bunch of helpful people there that knows a whole lot. By the way, i think i forgot the tradition:

Welcome to WebmasterWorld bjh5000 :)