Apache Wont Display PHP

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Cladinshadows
Forum Newbie
Posts: 10
Joined: Sun Aug 06, 2006 3:57 am

Post by Cladinshadows »

I added those lines at these points in the httpd.conf file in the conf folder in the Apache 2 folder:

First:
# 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.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule php5_module c:/php/php5apache2.dll
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so

Second:
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-httpd-php .php
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz


I am able to see the source code when I select source from the drop down tab on Internet explorer.

I restarted the server by doing so with the Apache controller in the sys tray and also the restart executable in my start menu.

Thanks for the assistance.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Did you download apache for Windows? The config looks like a Linux config.
Cladinshadows
Forum Newbie
Posts: 10
Joined: Sun Aug 06, 2006 3:57 am

Post by Cladinshadows »

The Installer says it's a win32 application as part of it's name.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Ok, try adding these addHandler calls in your httpd.conf file...

Code: Select all

# Put these just above the AddType declaration
AddHandler php-script .php
AddHandler php-script .inc
AddType application/x-httpd-php .php
Restart apache and see what happens.
Cladinshadows
Forum Newbie
Posts: 10
Joined: Sun Aug 06, 2006 3:57 am

Post by Cladinshadows »

Now when I attempt to open the file in my browser a message box pops up and asks whether I'd like to save the file or open it. When I choose to open it the page never opens, even to a blank page.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Just on the off chance, can you confirm that the file c:/php/php5apache2.dll is acutally there? Beyond that, you may need to wipe the slate clean and start all over again.
Cladinshadows
Forum Newbie
Posts: 10
Joined: Sun Aug 06, 2006 3:57 am

Post by Cladinshadows »

Yeah, the file is there.

I'll try wiping the slate clean then; thank you for your help. I really do appreciate your time and effort.

I'll post back with the results tomorrow.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

If you do not want to bother with installation issues any longer you might try something like http://www.apachefriends.org/en/xampp.html
Cladinshadows
Forum Newbie
Posts: 10
Joined: Sun Aug 06, 2006 3:57 am

Post by Cladinshadows »

Thanks. I'll give that a shot.

-I didn't post my progress yesterday because I wasn't able to make any (I had company drop by). However, installing a new php and using a different .ini out of the two they provide didn't help. This was already my second apache installation, but it was a lower version than the previous one due to another problem that was fixed by installing this version (that contains the threads stated problem).

I'll try one more time to do this manually but after that I'll just use xampp.
Cladinshadows
Forum Newbie
Posts: 10
Joined: Sun Aug 06, 2006 3:57 am

Post by Cladinshadows »

Okay, after reinstalling Apache (2.0.59 again) and reintering the info, php opens and is viewable. Now I can really start in on my learning book!

Thanks to Volka and Everah for your time and help.
Last edited by Cladinshadows on Thu Aug 10, 2006 3:38 am, edited 1 time in total.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Glad you got it working.
Post Reply