Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-24-2004, 12:44 PM   #1 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 167
DavH27 is on a distinguished road
Setting up Apache

I'm almost ready to take this entire thing and throw it out the window and carry on coding meagre HTML files with the biggest technological sepremecy being the add JS and external CSS file switching.

I've installed PHP. I've installed MySQL. I've installed Apache server. I've installed/unzipped phpMyAdmin

I go to http://localhost and nothing.

I know there is alot to get this started. SDE should know where I am so far.

PHP works because when I had Badblue running it would show php as showing. I gave made no changes to php configurations so that should all be working.

MySQL works because I can create that initial database using command prompt as instructed by sde himself.

Apache is installed with no changes made to it. It is currently sitting in my system tray with a nasty looking red square. When I double click it to see what's going on there is NOTHING. Not a sausage in either boxes. When I over over the systray icon it says I have no services installed...but I do...don't I?



This may all sound simple to you guys and that I'm constantly in need of somebody to hold my hand during this setup but the documentation isn't in baby language. Granted that people who need baby language are not fit to meddle with MySQL/php affairs but damnit!! I can do this!! I just need to get it all started!!

What I want to do is be able to double click a php file and it will appear just like a webpage without the 'Open With' box coming up.

Any help much appreciated.
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a
DavH27 is offline   Reply With Quote
Old 08-24-2004, 01:08 PM   #2 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 167
DavH27 is on a distinguished road
Duh watch this...

*Goes through start menu to open Apache in console window*
*Goes to http://localhost*

Heh heh sorry to waste some more time

But 2 things I want to know:
1. What is the need for the service monitor to me and what services can I install?
2. Must I manually run the WinMySQLAdmin and Apache consoles every time I want to see php files on my system? What little tricks can I use?

Will this work/be sensible enough:
If I want to test a page on locahost or to make changes to a database, I have links to the two pages in just one HTML page kept in the taskbar? I click it and if I want to test a page I just click the hyper link to C:\My Docs\folder\folder\test.php
or if I want to make changes to my Sql db then I click the link going to the index.php page of PHPMyAdmin ?

Sound clever enough? Or is there an easier way?

EDIT: You can ignore the above questions for now. I've tried reading the manuals and relvant documentation but when I change the default folder for Apache, the page @ http://localhost is always the same Apache startup page. HELP!!
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a

Last edited by DavH27; 08-24-2004 at 01:45 PM.
DavH27 is offline   Reply With Quote
Old 08-24-2004, 02:41 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,475
sde is on a distinguished road
you need to look at the apache configuration which is probably in a subset of directories from where you installed apache.

i believe the line you are looking for is DocumentRoot. this is where apache will look for web pages. after you change this line to what you want, ( maybe c:\www\ ) then you will need to restart apache.

i forget if you answered me or not, but is it possible for you to upgrade to windows xp? even win 2000 would make your life a lot easier.
__________________
Mike
sde is offline   Reply With Quote
Old 08-24-2004, 02:47 PM   #4 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 167
DavH27 is on a distinguished road
Not on this laptop! I need to finish building my new computer. I have some parts but need main parts (anybody selling anything for me - whole or parts? ) but definately not on this laptop!

I need to change jobs before this, though. Work somewhere for more hours then the computer can easily be paid for.

I tried changing the DocumentRoot but not sure if I restarted Apache.
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a
DavH27 is offline   Reply With Quote
Old 08-24-2004, 05:06 PM   #5 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
when in doubt, reboot!

Don't worry about any services since this is just for testing on win98.

Regarding double clicking on the php file - perhaps some association tricks could be done, but it may not be worth it. I set mine to open .php files by default in jEdit. I then open a browser window, type the localhost url and view the output. http://localhost/foo/test1.php

Not too much of a pain.

-r
idx is offline   Reply With Quote
Old 08-25-2004, 03:05 AM   #6 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 167
DavH27 is on a distinguished road
Ok guys I managed to serve up HTML pages through localhost !

But when I try and view php pages, they show as plain text as if PHP never existed! But it DOES! It is installed on my computer but the php pages are just plaintext php code.

SO CLOSE!
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a
DavH27 is offline   Reply With Quote
Old 08-25-2004, 03:38 AM   #7 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,151
Belisarius is on a distinguished road
You need to install a module for Apache, mod_php I think. Some of the more regular PHP users can help you on setting that up.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 08-25-2004, 04:44 AM   #8 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
check your httpd.conf file to make sure it is enabling php.

here are some snips from mine:

Code:
LoadModule php4_module        libexec/apache/libphp4.so

#########
AddModule mod_php4.c
############
<IfModule mod_dir.c>
    <IfModule mod_php3.c>
        <IfModule mod_php4.c>
            DirectoryIndex index.php index.php3 index.html
        </IfModule>
        <IfModule !mod_php4.c>
            DirectoryIndex index.php3 index.html
        </IfModule>
    </IfModule>
    <IfModule !mod_php3.c>
        <IfModule mod_php4.c>
            DirectoryIndex index.php index.html
        </IfModule>
        <IfModule !mod_php4.c>
            DirectoryIndex index.html
        </IfModule>
    </IfModule>
</IfModule>
#########################

    # PHP
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
The AddType statements are usually the problem.

-r
idx is offline   Reply With Quote
Old 08-27-2004, 11:20 AM   #9 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 167
DavH27 is on a distinguished road
Wow that's a bit extensive, isn't it?

I have put the correct lines in the config file as the php manual says to do. All I need now is the php5apache.dll file. It is aparently supposed to come with the install but I didn't get it for some reason.

I have also read somewhere that the zip version of the binary has the .dll for sure so I'm downloading that now.

I've given up on MySQL for now.

I'm going to get a new job to pay for a new computer. Until then, I'm gonna sharpen my Proggie senses and go full blast at php. I shall be leaving behind vb6 and the HTML layers I wanted to finally learn and just go full speed at php.

I just want to make a living
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a
DavH27 is offline   Reply With Quote
Old 08-27-2004, 12:21 PM   #10 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 167
DavH27 is on a distinguished road
HAAAAAAH !!!

Finally got php working!!

Okay - every damn forum thread and tutorial all over the Internet I looked through, I could only find one solution that worked for me. It was on this horrible run down and unproffesional forum that had been slapped together half-assed by an author that couldn't even handle the fundamentals of English. It worries me that he programs. It worries me even more that he foun d the solution and so many other people haven't.

I had followed the php manual as recommended (wow documentation that HELPS!) but the Apache module couldn't find the dll file. That is because for some reason, everybody who instals the windows installer of Apache doesn't have the php#apache.dll file.

So I go and download the zip version of php5. I unzip and extract the relevant file and put it in C:/php. Now the error I'm getting is saying it needs to be in C:/php/sapi. Why? I don't know. That fodler doesn't exist. So I make one and move the dll file and VIOLA!!

It works!!

WHOOPEEEEE!!

EDIT: Hey SDE and Admin -- do you want to drive more visitors to this site? Then I recommend offering this file for download. I don't know if it is feasable but maybe as an attachment to an article (that I could write) that explains how to get PHP# and Apache to work together.

I have tried so many search string combinations to try and find this PHP5Apache.dll and I bet hundreds of other people do the same every day. It's not a large file, 36kb so it won't be a huge drain on resources. It will encourage not only encourage more visitors but your site is more likely to be higher in search rankings we all know that's always good!
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a

Last edited by DavH27; 08-27-2004 at 01:58 PM.
DavH27 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting the path for python scripting Intensegutwound All Other Coding Languages 7 11-23-2004 06:32 AM
debian / apache / http authentication sde Linux / BSD / OS X 4 08-02-2004 02:55 PM
fresh apache install sde Linux / BSD / OS X 3 01-05-2003 10:53 AM
restarting apache in debian. sde Linux / BSD / OS X 4 06-22-2002 12:27 AM


All times are GMT -8. The time now is 11:27 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting