WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

IT Discussion Forum Having IT issues? Got IT questions? Who doesn't? If you can't get your Apache to work with your MySQL or your php is choking on your ODBC... Let's see if we can help you come up with some ideas.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-29-2003, 08:54 PM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default Apache Server Configuration

I've just installed Apache (and mySQL and PHP) on my system so I can test PHP files locally.

It works, but I have a problem.

If I create a form with a submit button in it and test it locally, I get the message:

You don't have permission to access /< on this server

If I create a proper form designed to call a PHP script, the message received indicates clearly that the variables from the form are not being passed to the PHP.

The script works fine online - so there are no errors in the code.

I realise that I've not set something in the Apache configuration file, but I've no idea what.

Any ideas, anyone?
__________________
Sualdam
Reply With Quote
  #2 (permalink)  
Old 01-03-2004, 08:18 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default Arrrrg!

Hey, Sauldam, I hear you loud and clear. I have all kinds of funky errors on my IIS install of php/cgi.

I was thinking to do this anyways, so I will fir up my apache and see what I can come up with. I am going nuts, well okay I'll live lol, a little with getting denied access as well, but just in Firebird! so I don't know, but I will try to get some ideas back here in the next few days.
Pretty frustrating, eh? I wanted the same thing, of course, bur it is almost like I might as well just test them on remote host for all the trouble!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #3 (permalink)  
Old 01-03-2004, 10:03 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

It's driving me nuts, as well!

I'm sure it must be a simple line missing in the Apache config file(s) or a wrong value assigned to something.

I mean, it's TRYING to do it it but Apache won't let it (localhost) do it.
__________________
Sualdam
Reply With Quote
  #4 (permalink)  
Old 01-06-2004, 03:49 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default Help arrives?

Sauldam, I have been meaning to try this in the past but forgot about it recently:http://www.analogx.com/contents/down...rk/phpconf.htm
Description: "PHP is great, but the configuration side of things still leaves a bit to be desired by most Windows users, and that's where AnalogX PHPConfig comes into play!
AnalogX PHPConfig is a graphical frontend to PHP's php.ini file, where all of configuration of PHP takes place. The end result is that you can spend more time on your PHP code and less on tweaking their .ini file. "

I think that now is a good time for me to try it. I don't like going into the .ini file and trying to find 'line 647' etc. and editing in case my syntax is off. I've already edited the wrong line before as well!

And, FYI, these guys make killer software, it is free, clean, and just check out the software, especially the network stuff. One of my favourite sites!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #5 (permalink)  
Old 01-12-2004, 07:49 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Sauldam, did this issue resolve for you yet?
Seems that there are two types of installation procedures, I am just rehashing the setup - I think that I used the '.exe' install.
I have suddenly been getting a "Password Required" page when I try to view my pages with Firebird!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #6 (permalink)  
Old 01-12-2004, 07:55 PM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

No, I am still testing by uploading.

I downloaded that utility you mentioned and it changed things so that I can now call external PHP files - but variables are not passed from one to the other.

I didn't try very hard, though, because I'm working on some PHP for someone right now and didn't have time.
__________________
Sualdam
Reply With Quote
  #7 (permalink)  
Old 01-12-2004, 08:11 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Okay, I think that you are right about the config file in Apache. I will see if I can find something.

<update>
Okay, it seems that Apache is not loading a lib at startup, or most likely you need this in the 'httpd.conf' in the conf folder (apache/conf/httpd.conf)(near the end of sec.1,about 50 lines before 'Section 2: 'Main' server configuration'):
Quote:
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `apache -l' for the list of already
# built-in (statically linked and thus always available) modules in your Apache
# binary.
#
# Note: The order in which modules are loaded is important. Don't change
# the order below without expert advice.
#
#LoadModule anon_auth_module modules/mod_auth_anon.so
#LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule digest_auth_module modules/mod_auth_digest.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule digest_module modules/mod_digest.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule speling_module modules/mod_speling.so
LoadModule info_module modules/mod_info.so
LoadModule status_module modules/mod_status.so
#LoadModule usertrack_module modules/mod_usertrack.so
LoadModule php4_module c:/inetpub/php/sapi/php4apache.dll
You also have to add this in the ClearModuleList, just below LoadModule:
#AddModule mod_unique_id.c
AddModule mod_php4.c
AddModule mod_so.c
AddModule mod_setenvif.c


I am installed in IIS in WinXP, so your path might be different. I am really unsure of things in this area, though.

But I have found that the error you refer to, that you are getting, indicates that PHP is not loading.
Other info I found suggests that you may have to re-install Apache.
I just want to give you an indication of what to look for. BY NO MEANS should you take my advise at face value here!
Where is redcircle?! Halp...:o)
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #8 (permalink)  
Old 01-12-2004, 08:58 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Here is what I found for Apache documentaion:
http://httpd.apache.org/docs-2.0/

This is probably better than what I got above :
Subject: Apache/PHP Config Problem
http://www.computing.net/linux/wwwbo...rum/23024.html

I think I am going to just re-install mine! lol
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #9 (permalink)  
Old 01-16-2004, 04:20 PM
USALUG's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: USA
Posts: 114
USALUG RepRank 0
Default

Do any of these url's work with your server ???

http://localhost or http://127.0.0.1 or http://yourcomputername or
http://yourcomputerslocalipaddress

localhost should open up your "apache test" page.

http://www.thesitewizard.com/archive/php4install.shtml
may be of some help also.
__________________
http://www.usalug.org
USA Linux Users Group
usalug.org is an online forum for Linux users.
Reply With Quote
  #10 (permalink)  
Old 01-16-2004, 04:58 PM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

Did you mean mik, me, or both? :)

In my case, both localhost and 127.0.0.1 launch the index page that I have sitting in the target directory (htdocs) I set up when I installed Apache.

It did run the Apache default page when I first installed it.

The behaviour has changed whilst I've been trying a few things.

Initially, as per my original post, PHP pages could not call external PHP files.

After I tinkered with the config file I got it to handle that, but variables are not passed across (i.e. they are null). The same scripts work online.

I'll read through those links - thanks for them, by the way - when I get a chance and let everyone know if I solve anything.

Fingers crossed.
__________________
Sualdam
Reply With Quote
  #11 (permalink)  
Old 01-16-2004, 05:46 PM
USALUG's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: USA
Posts: 114
USALUG RepRank 0
Default

both actually :)

Since you had Apache up and running, and assuming php acutally installed.... the above link I provided probably has the answer:

Quote:
a. Running PHP as an Apache module

To configure Apache to load PHP as a module to parse your PHP scripts, use an ASCII text editor to open the Apache configuration file, "httpd.conf", typically found in "c:\Program Files\Apache Group\Apache\conf\".

Search for the section of the file that has a series of commented out "LoadModule" statements. (Statements prefixed by the hash "#" sign are regarded as having been commented out.) Add the following line after all the LoadModule statements:
LoadModule php4_module "c:/php/php4apache.dll"

If you are using Apache 2.X, remember to use "c:/php/php4apache2.dll" instead of "c:/php/php4apache.dll".

Next, for Apache 1.3.X users, search for the block of "AddModule" statements. Add the following line after the last "AddModule" statement:
AddModule mod_php4.c

Don't worry that you can't find a "mod_php4.c" file anywhere on your system. That directive does not cause Apache to search for the file on your system. For the curious, it specifies the order in which the various modules are enabled by the Apache server.

If you're using Apache 2.X, you do not have to insert the AddModule directive. It's no longer needed in that version. Apache 2.X has its own internal method of determining the correct order of loading the modules.

Finally, search for "AddType" in the file, and add the following line after the last "AddType" statement:
AddType application/x-httpd-php .php

If you need to support other file types, like ".php3" and ".phtml", simply add them to the list, like this:
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
Makes special note of where the files are for APACHE2 ... as they are NOT the same as previous versions.

HTH's :)
__________________
http://www.usalug.org
USA Linux Users Group
usalug.org is an online forum for Linux users.
Reply With Quote
  #12 (permalink)  
Old 01-16-2004, 06:45 PM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Posts: 1,087
Sualdam RepRank 0
Default

Well, I've tried that and when I tried to start Apache I got the message 'the apache service did not start' and that no error was reported.

I did a bit of trial and error and found that it is the LoadModule bit that stops Apache in this case - comment it out and it fires up.

Then, as you do, I decided to actually think about what I was doing. Although I have PHP installed in the root directory, there is no dll file of the type indicated in that path. And I couldn't find one.

And yet both Apache and PHP work on their own.

I'll read up on those links at the weekend, but thanks for the suggestions so far.
__________________
Sualdam
Reply With Quote
  #13 (permalink)  
Old 01-16-2004, 07:03 PM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

Yes, thanks USALUG. I have PHP installed to C:\PHP as well as ~\inetpub\PHP!. I think will check out reinstalling, I want to run IIS and Apache2 on seperate OS's(different partitions) to mirror the hosting providers that I deal with dir. structure. It would be nice to be able to configure/debug scripts on my box and then straight FTP them.
I know enough what to look for now during install.
I will use phpinfo(up there, lol) and imitate!
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
  #14 (permalink)  
Old 01-19-2004, 07:06 PM
godzilla's Avatar
WebProWorld Member
 

Join Date: Aug 2003
Location: Montreal, CA
Posts: 68
godzilla RepRank 0
Default

I think that the best Idea in all of your cases is to install PHP Triad(search on google for this).

It is preconfigured, preformated Apache, PHP, Mysql package. It will run just after the install :-).

As for the variable passing check on php.net for setting SuperGlobal variables. Remember that in PHP the variable is passed trough $_POST, $_GET, $_SESSION etc. super global variables. If they are not expressly enabled in the system you will get empty variables when loading forms.

I personally run a server on my own compuetr and do the testing also localy and never had problems with the triade package

I guess this could help...
__________________
Everything has its reason.
Your greatest glory doesn't consist in falling, but rising every time you fall and this is what defines a perfect human.
Godzilla's pass-time
Reply With Quote
  #15 (permalink)  
Old 01-20-2004, 09:52 AM
mikmik's Avatar
WebProWorld 1,000+ Club
 

Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 3,406
mikmik RepRank 1
Default

godzilla, you suggest
Quote:
I think that the best Idea in all of your cases is to install PHP Triad(search on google for this).
That sounds great. Will try it out.

Good point with global variable. I have had to change some scripts before to $_SERVER from something (it was a while ago now) and that sounds like what you are saying. I shall read up and pay attention to globals.
Thanks.

Don't know if that one will help sauldam, though.
__________________
What I am is what I am, are you what you are, or what.
Eddie Brickel
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > IT Discussion Forum
Tags: , ,



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

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


Search Engine Optimization by vBSEO 3.2.0