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 -> Apache View previous topic :: View next topic
Reply to topic   Topic: installing php on apache ends in "index of/"
Author
toetbrech



Joined: 15 Feb 2010
Posts: 5
Location: Germany

PostPosted: Mon 15 Feb '10 23:07    Post subject: installing php on apache ends in "index of/" Reply with quote

hi, i've win xp (home) and i've installed php 5.31 manually on apache 2.2.14. php is indicated on the baseline of apache monitor, but when i try to open the simple test.php <? php phpinfo(); ?> by my web browser with
127.0.0.1 only
Index of /
test.php
is shown. Surely, this has quite simple reasons, but i cannot find them.
thx for any help
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 16 Feb '10 5:30    Post subject: Reply with quote

is there an index.html file in there too?
Back to top
toetbrech



Joined: 15 Feb 2010
Posts: 5
Location: Germany

PostPosted: Tue 16 Feb '10 10:32    Post subject: Reply with quote

thx, glsmith. no, it isn't.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Tue 16 Feb '10 13:42    Post subject: Reply with quote

Which url do you type into your browser? Just http://127.0.0.1 or http://127.0.0.1/test.php ?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 16 Feb '10 16:52    Post subject: Reply with quote

Then that is expected behavior. If there is no file specified by the DirectoryIndex directive in the directory, you will get the index. There's a caveat here in that Options must also be set to "All" or "Indexes" for said directory, and in your case it must be one of them or your would have gotten a 403 error.

See:

http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex
http://httpd.apache.org/docs/2.2/mod/core.html#options
Back to top
toetbrech



Joined: 15 Feb 2010
Posts: 5
Location: Germany

PostPosted: Tue 16 Feb '10 23:14    Post subject: Reply with quote

James:in both cases it doesn't work
glsmith:i'd options Indexes FollowSymLinks before
and i've changed it to options All but that brought no effect.
i almost believe that php is not installed correctly but
in Apache Service Monitor one can read apache/ 2.2.14(win32)php/5.3.1...
many thx for your answers
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7298
Location: Germany, Next to Hamburg

PostPosted: Wed 17 Feb '10 0:08    Post subject: Reply with quote

toetbrech wrote:
James:in both cases it doesn't work


Doesn't work? Which error do you get? 404 File not found? Forbidden? Blank page?

So if you think you did not install php correct, please post your line you added into httpd.conf to make php working.
Back to top
toetbrech



Joined: 15 Feb 2010
Posts: 5
Location: Germany

PostPosted: Wed 17 Feb '10 1:14    Post subject: Reply with quote

james: there's a popup window saying:test.php-do you want to download this file? ......
i've added
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpdphp .php
PHPIniDir "c:/php"
to httpd.conf and changed the path into "c:/public_html" in DocumentRoot
and <Directory>. In the folder C:\php i renamed php.ini-production to php.ini and also changed doc_root into "c:\public_html" in this folder.
Back to top
Millennium



Joined: 17 Apr 2006
Posts: 179
Location: Leiderdorp, NL, EU

PostPosted: Wed 17 Feb '10 10:04    Post subject: Reply with quote

While using AddType should work (if you correctly insert the type) is using AddHandler the correct way.

Code:

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType text/html .php
AddHandler application/x-httpd-php .php
PHPIniDir "c:/php
Back to top
toetbrech



Joined: 15 Feb 2010
Posts: 5
Location: Germany

PostPosted: Wed 17 Feb '10 10:57    Post subject: Reply with quote

Millenium: Thank you very much. Your advice resolved the issue.
Thx to all, once more.
Back to top


Reply to topic   Topic: installing php on apache ends in "index of/" View previous topic :: View next topic
Post new topic   Forum Index -> Apache