Forum Moderators: phranque

Message Too Old, No Replies

Apache help!

         

carpe_diem

6:04 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Hi all!

I'm losing my mind! I'm totally new to trying to learn php, apache set up, mysql etc.

I have been trying ALL day long to install Apache on Windows XP Home edition and the only way I could see that little green "play" icon was if I installed it as if I was going to use it via an intranet or whatever. I just want to teach myself php to be honest.

Thing is, now it "appears" to be loaded but when I type in my browser [localhost...] I get nothing! And, I've downloaded php 4.3.10 and can't seem to figure out how to do it manually as recommended by php.net. ARGH!

Can someone please help me figure out how in the first place I can get my Apache server to show when I type [localhost...] in my browser as opposed to it just showing "can't find page"? Please? The tutorials are so mind numbing for a newbie!

And, once I get that going, what is all this about putting a php.ini folder in where? I just want to be able to run a server on my comp to teach myself php.

I downloaded a mysql thing too and haven't even got the energy to try to get that set up. Is there an order anyway to installing all this? I downloaded and installed a zend optimizer and can't find the bugger in my system!

*sigh

Well, if anyone can help I would sincerely appreciate it. Thanks in advance

*time for a drink*

IamStang

6:22 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Did you edit the httpd.conf file to reflect localhost?

And did you install everything individually? PHP, Apache, etc? You might remove them and then download and install AppServ network. Everything will be placed where it needs to be and configuration is minimal. Just a thought

[edited by: IamStang at 6:27 pm (utc) on Mar. 13, 2005]

[edited by: jdMorgan at 2:12 pm (utc) on Mar. 14, 2005]
[edit reason] Removed URL per TOS. [/edit]

carpe_diem

6:24 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Maybe this will help you seasoned pros help out a newbie like me. This is the message I get when I try to "start" Apache. Obviously something isn't working and I really am stumped. Please could someone help me figure this out and once that's workin' could someone advise on what to do next regarding installing php and mysql. PLEASE! :)

Thanks everyone willing to help out the programming inept like meself!

Here's the message I get: "<os 10048>Only one usage of each socket address <protocol/network address/port> is normally permitted. :make_sock: could not bind to address 0.0.0.0:8080 no listening sockets available, shutting down
Unable to open logs"

Thanks to EVERYONE! Help please!

PS - I did read over the tutorials but man if they aren't jargon-fied. I know a bit of html and want really really want to learn php just can't get my skull around it all

Cheers!

carpe_diem

6:26 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Hi IamStang!

Wow, thanks mate for responding. Um, no, I didn't edit anything cause to be honest, I'm so new to this that I didn't know that's what I had to do. Would u mind kind of explaining what that is or at least how to do it please!

Thanks so much

IamStang

6:48 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



I edited my last post above so take a look at it again.

The httpd.conf file is the configuration file for apache. Mine is located in C:\AppServ\conf\

You will need to open that file, wherever yours might be located, in a text editer. Be sure to make a backup file before you edit it though!

Open the file in the editor and add the following to the bottom of your file:

NameVirtualHost localhost
<VirtualHost localhost>
DocumentRoot C:\AppServ\www
#DocumentRoot should reflect where your webfiles are located
ServerName whatever_you_want_to_call_it
</VirtualHost>

then save file and restart the server.

Of course, this might not be the fix for your problem entirely, but it's a start.

carpe_diem

7:37 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Thanks IamStang,

I'm downloading the appserv as I type this. I can't tell but does the appserv include apache/php/mysql together or does it just somehow put everything in its place? Either way sounds an improvement to what I've been experiencing.

Anyway, I'll give that a try and see what happens.

Also, were you saying to edit the httpd file? It seems like a bit text file when I open it in notepad so how would I exactly edit it?

Thanks again, any more advice would be great...CHEERS!

IamStang

7:56 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



The program when you run it will place everything where it needs to be. It will also, edit the httpd.conf file to a point. There are still a few lines that you will need to edit. However, once you are through installing, go to Start - Programs - AppServ - Apache Control Server - Start

It will tell you if there is an error in starting. If not, try [localhost...] and see if you get the standard Apache Server page. If you get that page, you are rounding first and headed for second.

Not sure what you mean about editing the file. But I open mine in EditPad. It may be too large of a file for NotePad. I never use NotePad, so I wouldnt know.

Any text editor will work that doesn't have a limit on number of characters/file size.

carpe_diem

8:15 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Actually IamStang,

I was wondering as I'm downloading appserv and say it says on the download something about PHP 5.0.2/Apache 1.3.33/MySQL 4.1.7 and I happen to have downloaded PHP 4.3.10, does this affect how appserv will work? In other words, do I have to download exactly what appserv says on its download?

Sorry about all the newbie queries, you are mos' definitely helping me out.

Thanks, I'll keep trying...I really appreciate your time and advice

IamStang

8:23 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



You wont need your older version. That program will install the latest version. Everything comes bundled in the file you are downloading.

carpe_diem

8:51 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Hi IamStang,

It's weird cause it now says a different error.

[error] <os 2> The system cannot find the file specified. : No installed sercie named "Apache2".

I typed in the part you mentioned earlier in my httpd.conf and hopefully did it correctly.

(NameVirtualHost localhost
<VirtualHost localhost>
DocumentRoot C:\AppServ\www
#DocumentRoot should reflect where your webfiles are located
ServerName whatever_you_want_to_call_it
</VirtualHost>)

Since I downloaded the appserv I am now getting (at least) a different error message but I wonder why it won't recognize Apache2. Could there be something I need to turn on/off as this is a brand new laptop?

Actually it's probably just the user! lol Anyway, if you have any ideas please feel free to mention. You've been a great help so far as I didn't know about appserv. I just know I'll be able to crack this nut yet!

IamStang

9:01 pm on Mar 13, 2005 (gmt 0)

10+ Year Member



Open the httpd.conf and find:
# 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.
#
ServerRoot "C:/AppServ/Apache2"

The above line should point to where Apache was installed. If not, change it and try again.

Also, if you have AOL Instant Messenger, I am llcranialvoidll

carpe_diem

1:03 pm on Mar 14, 2005 (gmt 0)

10+ Year Member



Thank you! Thank you! Thank you! IamStang!

I finally got it working last night where at least I can see that sort of introductory page.

I'm not sure what to do or where to go from now but if you have the time could you give me an idea of what I need to do next if I want to start messing about with php, for example tutorials etc?

Do I need to create a web page in html, save it in a folder and type in my browser "http://localhost/website?" I don't ever plan on hosting my own site I just want to be able to teach myself php and use my comp as a server and that's about it. Ideally as I'm designing my very first site that will be hosted somewhere else I want to have a form that people fill out and it shows errors if they miss a required field. I know there are scripts I can download etc. but I would also like to learn php so if I have to customize or make my entire site in php I can do so eventually.

I'm just not sure where to go from here. If you have any more suggestions that would be excellent.

Seriously, thanks again for your help! I spent almost 9 hours trying to get apache to work and the appserv site you gave me worked in minutes! *sigh But, I'm stoked it's working now (so far) :)

Cheers and if I may ask, are you a php programer?

IamStang

12:56 am on Mar 15, 2005 (gmt 0)

10+ Year Member



Good Job! Glad you got it working.

I am going to start with your last question. No, I am not a PHP programer. I have done a great deal of graphics work and html scripting over the years. And a few years back, I started messing with javascript. Up until recently, that was about the extent of my web design experience.

An internet buddy asked if I could tweek a cgi script he was using about a month ago. I told him that I had never done cgi scripting but that I would give it a try. I learned what I needed to know to be able to edit his script but had no place to test it. That's when I downloaded the exact same program you downloaded yesterday.

It took some research, but I managed to get it working rather nicely. However, I took a look at the access logs one day and noticed several "hack" attempts that made me scramble for info on security. It was then that I decided to forgo the Windows/Apache setup in favor of a Linux/Apache setup. And here I am today. (Still trying to get the Linux box running correctly, by the way).

Now, on to your question about what to do next. Place a "test" index.html/index.htm file in your www folder and load [localhost....] Your new test page "should" load. If it does, great! Create your pages and put them in www or in a folder inside www. And have fun learning php. If it doesn't, there is a line or two in the config file that needs to be tweaked.

carpe_diem

9:54 am on Mar 15, 2005 (gmt 0)

10+ Year Member



Hi again IamStang,

Thanks for the tips and I'll try puting up an index.htm page.

Naturally, I have a couple of questions. :)

First is, trying to figure out how to get php on my system. I assume the download you suggested that comes with apache, php, mysql are simply the files but then need installing (?). There was an installation type text file and when I read that it was mentioning about putting (I think) certain .dll files or something like that into a PATH folder, etc. Still a bit techy for me to understand but I'm trying. I just want to make sure php is installed and running. Does php automatically get installed once I download this package from appserv? Or, do I need to manually install it? Seems like I do.

And, to ask about something you mentioned in your last reply. The security issue. I only want to use php to do tests and to try out tutorials, etc. to get the hang of the language and I'm too much a newbie to know if hackers are attempting to get into my system. I won't use php for any online purposes except when I eventually create something I like then I'll upload them to my host. Can you suggest the best way to protect my computer cause my naivete could cost me. It's crazy to think that just wanting to test a few scripts on my own local server could let hackers and/or that spyware/adware garbage in.

Anyway, thanks IamStang for all your help and if you could help me to make sure I've installed php correctly or suggest a site that has a good set of installation instructions (I keep looking for one) for a total newbie that would be great. I know some html as I work as a web designer but I'm a newbie webdesigner too. :) 4 months ago I couldn't design a website and now that I can handle basic Dreamweaver/html I want to push to the next level into programming but mostly interested in php than asp per se.

Well, thanks again and I sincerely appreciate your time. I'm sure once I get this I'll be off and running! Good luck as well!

til next

spuzzdawg

10:57 am on Mar 15, 2005 (gmt 0)

10+ Year Member



IF you're having troubles with appserve then try xampp.

[apachefriends.org...]

It's an Apache2, PHP, PHPMyAdmin, Mysql, mercury mail, file something or other ftp server etc etc

The apache server comes preinstalled with quite a few mods like perl and that. So it has everything u need and a little bit more. But you only have to use of it wat u want.

After installing i htink the only things you are meant to configure are security passwords for the xampp base folder, mysql root passwords and phpmyadmin passwords all of which you don't need if the site is not accessable to the public. And then a few site name configuration type things in apache.

THe mail server and ftp server require a lot more configuration but it sounds like you don't want to use them anyway. All in all - xampp will run straight after install without any config - but there are some things u should fix up.

Good luck with it

Spuzzdawg

IamStang

12:00 pm on Mar 15, 2005 (gmt 0)

10+ Year Member



My suggestion would be to, if you don't already have one, purchase a router. They're realitively inexpensive. Usually easy to setup. And probably the best bang for the buck.

A good one will allow you to set up firewall rules that block access from the outside world to "ports" on your pc.

The typical install of AppServ sets Apache to "listen" to port 80 on your computer. Thus, if someone new your IP address, they could type it in the address bar of their browser, followed by :80. That would load your index page on their browser.

Setup and configuration of a router would be based on the model you have/purchased. You would need to consult the manuals or manufacturer's website for more info on that.

Another option might be a software firewall. However, since I am behind a router, I haven't messed with software firewalls for this purpose. If you are using one, again, consult your manual or developer's website.

Hope it helps!

carpe_diem

7:20 pm on Mar 16, 2005 (gmt 0)

10+ Year Member



Hey thanks again IamStang and spuzzdawg too! You know, the worse thing is wanting to learn something technical (for me anyway) having that burning desire only to feel plagued by something that's probably relatively simple but feels like the hardest flippin' thing to get! :)

Anyway, slowly but surely I'll figure this out and laugh at myself once it's going and feeling "how simple". Then again, it's only simple if you know how eh?

I'll give both your suggestions a try, no doubt. It seems no matter how much you want to know something it still ends up taking time. Perseverance...that's what it's all about.

So thanks again and I appreciate your time to guide my programming challenged self around. I can't wait to get some cool coding done and enjoy the "victory".

See you again in the forums! (hopefully I'll get things rockin' and rollin' and won't need a babysitter next time)

Cheers!

carpe_diem

9:22 pm on Mar 16, 2005 (gmt 0)

10+ Year Member



Hi again guys (and gals of course),

I do have a quick question I tried this time the xampp from apachefriends. It seems to be working ok but I downloaded a free script for a form, for example, and me being quite ignorant to php I thought I could just download the file, and open Dreamweaver and hit F12 and it would load the form. Nothing. So, I realized to put it on my local server [localhost...] by putting the php doc into the httpdoc folder and...Nothing.

Am I doing something wrong? Is it not simply a matter of opening a php document but rather creating a simple html file, create a table or something then put the php code in that? Argh!

Is there any way to test a free download script in php from either Dreamweaver? Do I need to place the free php script in a particular folder to test on my local server?

Thanks for the help! Any tips IamStang or anyone else here would be saweet!

Cheers

IamStang

10:34 pm on Mar 16, 2005 (gmt 0)

10+ Year Member



If you open the script in your browser, is it showing an error? 404 Not Found? Internal Server Error?

Also, have a look at your error log. It is very useful in finding out what problem you are dealing with. If your's is setup like mine, it would be in C:\Appserv\Apache2\error.log. It can be viewed with the same program you used to view and edit the httpd.conf file.

If you are getting an error, what is being reported in the error.log?

spuzzdawg

2:01 am on Mar 18, 2005 (gmt 0)

10+ Year Member



Its hard to answer your question because there could be many things wrong. In my experience, if you are viewing a PHP file in a web browser and all you get is a white page (this is wat i assume u mean by u getting nothing)there is something wrong with the PHP code. But not something wrong that causes PHP to give u an error. Usually something like:

If variable equals this then do this

without any statements on wat to do if ur variable doesn't equal that. So the PHP code just doesn't run anything and you get a blank white page.

in XAMPP the error files are located in xampp\apache\logs.

You need to remember also that PHP is a server side script. So unlike normal HTML files - double clicking a PHP file will not cause it to show properly in a web browser. The file must be placed in a folder that the web server is set up to show over the web. In XAMPP this is by default /xampp/htdocs. All rellevant services need to be running as well to prevent errors. In XAMPP u can run the XAMPP control panel to start and stop individual services. Make sure u leave this program running while u wish to use apache.

I think it's simpler to try and manually open the page u would like to test with a web browser reather than pressing f12 in dreamweaver. From memory this button saves then opens the file - depending on how dreamweaver is set up this may not cause the page to be viewed through the server - it may directly open the file and thus not view correctly.

I hope this answers ur question. U may want to post the PHP script u got here or in a file if its not too big and freely available somewhere else. Maybe someone can take a look at it and see if its at fault

Spuzzdawg