php local configuration error

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

Post Reply
bobvaz
Forum Newbie
Posts: 6
Joined: Wed Dec 06, 2006 9:19 am

php local configuration error

Post by bobvaz »

I need to resurrect this problem. Hopefully I am now in the right forum. I am a newbie and recently downloaded php and apache current versions. Working in the local host directory, my problem seems rather simple - I cannot call a php page from an html page. I get the windows alert asking if I want to download the file....I have searched the forums for help on addHandler and addType...I have changed the httpd config file for each of the suggestions, restarted php, but still get the message.....I am stumped and would appreciate any help. Thanks in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I think time may be best served if you used a tool such as Xampp.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

When you say you restarted PHP do you mean you stopped and started Apache? Can you post the Add Handler lines of your httpd.conf file so we can see them?
bobvaz
Forum Newbie
Posts: 6
Joined: Wed Dec 06, 2006 9:19 am

Post by bobvaz »

Sorry for the delay, I was gone for a week......
attached are addHandler lines from config file

#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi

#
# For files that include their own HTTP headers:
#
#AddHandler send-as-is asis

#
# For server-parsed imagemap files:
#
#AddHandler imap-file map

#
# For type maps (negotiated resources):
# (This is enabled by default to allow the Apache "It Worked" page
# to be distributed in multiple languages.)
#
AddHandler type-map var .bat .pl
AddHandler server-parsed .html
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
AddHandler server-parsed .shtml .html lhtm
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

My php.conf (or the PHP handling in httpd.conf) looks something like this:

Code: Select all

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_module modules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
bobvaz
Forum Newbie
Posts: 6
Joined: Wed Dec 06, 2006 9:19 am

Post by bobvaz »

Thanks I will try it.....
Apache will not start.....I do not have the libphp5.so in any library.....I have some others that other posts have used, i.e. php5apache2_2.dll" . If I need to load the prior, where do I find it? Thanks again.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Sorry, my installation is a linux install. If you are on Windows, yours should be a .dll.
Post Reply