logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Setup problem: Apache/PHP
Author
BEEDO



Joined: 21 Apr 2011
Posts: 4
Location: Kitsap County, WA USA

PostPosted: Thu 21 Apr '11 2:22    Post subject: Setup problem: Apache/PHP Reply with quote

Hi,

First I'll say that I am setting up an Apache/PHP/MySQL combo on my XP home edition in order to learn them. So I don't know much, yet.

I installed Apache "httpd 2.2.17-win32-x86-no_ssl.msi" from Apache.org, input "http://localhost" , received "It Works!"

Next I installed PHP 5.2.17-win32-VC6-x86.msi" (thread safe) from php.net. In the php.ini I changed

; cgi.force_redirect configuration below
doc_root =

to

; cgi.force_redirect configuration below
doc_root = "C:\Program files\Apache Software Foundation\Apache2.2\htdocs"

and

;session.save_path = "/tmp"

to

;session.save_path = "C:/Windows/tmp"

Then in the Apache httpd.conf file I changed

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

(by adding the "index.php" part in the above)

And stuck this on the end:

LoadModule php5_module "C:/PHP5/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/PHP5"

Now I thought I'd look at the Apache Service Monitor after a restart to see if it recognized the php, but I couldn't figure out how to open the service window. Then I typed http://localhost/php.info but got a 404.

I have done nothing with MySQL yet.

I am sad to say it took 8 hours to get this far, but that will help you gauge how much I will appreciate some help.

Thanks,

Basil
Back to top
somnang



Joined: 08 Apr 2011
Posts: 61

PostPosted: Thu 21 Apr '11 8:28    Post subject: Reply with quote

Here's a short guide on installing Apache... might help, might not
http://www.apachelounge.com/viewtopic.php?t=2394
Back to top
Virsacer



Joined: 16 Jan 2010
Posts: 108
Location: Germany, Darmstadt

PostPosted: Thu 21 Apr '11 10:41    Post subject: Re: Setup problem: Apache/PHP Reply with quote

BEEDO wrote:
Then I typed http://localhost/php.info but got a 404.

Why "php.info"?
The php interpreter parses ".php" files and not ".info" files.

And ofcourse the file has to exist in your doc-root.
Have a look at this page: http://kb.mediatemple.net/questions/764/How+can+I+create+a+phpinfo.php+page
Back to top
BEEDO



Joined: 21 Apr 2011
Posts: 4
Location: Kitsap County, WA USA

PostPosted: Thu 21 Apr '11 19:40    Post subject: Reply with quote

Somnang, I noticed many posts that point to this 'guide'. It was from 2008 so I wasn't sure how archaic it has become. Remember that I know very little. What I want is a home server so I can learn Apache/PHP/MySQL. The guide you pointed to suggests I first uninstall the Apache and PHP because I used the msi (I thought it would be easier!) and install different versions. The main hazard mentioned is that uninstalling can leave little bits that can cause trouble later, while uninstalling. Since I haven't done very much, maybe it wouldn't be too difficult to round up those bits. If that is still a viable solution, in 2011, perhaps I can fall back upon it if I can't fix my current installation. It seems like all I need to do is figure out how to get the Apache to load the php module (I don't know if that is the correct concept).

Virsacer, I used 'php.info' because it was suggested by "Head First with PHP & MySQL" which provided an easier looking route than the other numerous books on the topic that I've checked out from the library and all the internet pages I've read.

I looked at the page you suggested.

"Step #2:Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your html (/home/00000/domains/example.com/html/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file."

I don't quite see how to translate that into my situation, because I barely understand what I'm doing. It would be easier if things worked as in the books, but of course what they describe is always in the past and different.

I believe I am trying to make the PHP recognizable to Apache, as a module, and to configure the Apache so it can access the PHP module. I think all I have to do is put a few lines in the php.ini and the httpd.conf files. The right lines in the right places.
Does it sound like my concept of my trouble is correct?

Thanks for replying, it is encouraging!
Back to top
Virsacer



Joined: 16 Jan 2010
Posts: 108
Location: Germany, Darmstadt

PostPosted: Fri 22 Apr '11 9:32    Post subject: Reply with quote

"Step 2" translated to your situation:
Move the file to C:\Program files\Apache Software Foundation\Apache2.2\htdocs

Basically when you type a URL like http://localhost/ThisIsATest.php Apache will look for C:\Program files\Apache Software Foundation\Apache2.2\htdocs\ThisIsATest.php
If that file does not exist you get the 404 Error.
Back to top
nimda



Joined: 22 Apr 2011
Posts: 2

PostPosted: Fri 22 Apr '11 11:26    Post subject: same problem... Reply with quote

I think since you have installed php and add line into httpd.conf (LoadModule php5_module "C:/PHP5/php5apache2_2.dll" )... apache doesn't start...

try to start apache manually by :

start a cmd command
go in your apache bin directory and tape : httpd

if the cursor go down without error message and without give you the prompt, apache started else you will have a the prompt with an error message...

from my part I fight since yesterday to make work php with apache...

I installed as the tuto (http://www.apachelounge.com/viewtopic.php?t=2394) said and before to add the line "loadmodule php5-module "c:/.../php5apache2_2.dll" => my apache started well (with it works page) after I added the line => my apache doesn't start saying "cannot load c:/.../php5apache2_2.dll into server: le module spécifié est introuvable"

I verified the good name of the dll and the good location, good path to PHP in my os...

my OS is a 2003 R2 standard FR.

all suggestions are welcome !!!
Back to top
nimda



Joined: 22 Apr 2011
Posts: 2

PostPosted: Fri 22 Apr '11 12:18    Post subject: Reply with quote

I fix my probleme by using the topic "http://www.apachelounge.com/viewtopic.php?t=3616"

and in the httpd.conf replace the line
"Options Indexes FollowSymLinks"
by
"Options Indexes FollowSymLinks Includes ExecCGI"

thank you VERY MUCH to your forum for the power knowledge database online !!!!
Back to top
BEEDO



Joined: 21 Apr 2011
Posts: 4
Location: Kitsap County, WA USA

PostPosted: Fri 22 Apr '11 20:43    Post subject: Reply with quote

Apache recognized my php module when I added this at the end of the file:

#
LoadModule php5_module "c:/Program Files/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/Progam Files/PHP/"

which I pasted from the php install.txt file after changing the 'phrasing' of the paths. Looks like it could be cleaner but I am moving on to install MySQL.

Thank you, virsacer! Your idea and translation of step 2 worked well.

nimda -I am glad that you fixed your problem.
Back to top
somnang



Joined: 08 Apr 2011
Posts: 61

PostPosted: Fri 22 Apr '11 22:59    Post subject: Reply with quote

BEEDO, looks like we are on the same objective. I am trying to install AMP on my Win7. Been trying to figure out why ModSecurity is not working well. Happy to know your problem is solved. I figure you direct httpd.conf to a wrong PHP installation folder but didn't bother to point that lol. And yeah "php.info" is not a supported extention, but "phpinfo.php" is.
Back to top


Reply to topic   Topic: Setup problem: Apache/PHP View previous topic :: View next topic
Post new topic   Forum Index -> Other Software