Click to See Complete Forum and Search --> : PHP as an apache 2 module


jammer42777
07-25-2004, 12:33 AM
hello,
I am very new to php (I've read a book on it that's about it)
but I was attempting to setup php.. After some working I decided to use apache v2.
After getting apache working I was trying to get php to work. Every time on my browser (when I load a practice script) I get a blank page. Have I made the appropriate modifications to my apache conf file? or do I need to modify my php.ini file as well.

I've enclosed portions that I've added to my httpd.conf file in apache2

# LoadModule foo_module modules/mod_foo.so
#
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
LoadModule php5_module "c:\php\php5apache2.dll"

Action application/x-httpd-php "c:\php/php.exe"

# file mime.types for specific file types.
#
#AddType application/x-tar .tgz
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/apache/Apache2/cgi-bin/"


These are samples, however, php simply will not render yet, are there any lines that I should be adding?
Should I edit my php.ini file.
I'm sortof at a loss here, and any help would be appreciated.

--Joshua

rachel2004
07-25-2004, 05:32 AM
When you configured PHP, did you have a line like this:

./configure --with-apxs=/usr/local/apache/bin/apxs

I am speaking from PHP being installed under Linux.

After your configuration of PHP, the only thing you should need t change in your httpd.conf file for a basic build are the AddType lines, which you seem to have done.

Did copy to the php.ini file:

cp php.ini-dist /usr/local/lib/php.ini

You run that above line from your PHP directory.

Did you restart Apache so Apache can re-read the httpd.conf file and enable your changes?

jammer42777
07-25-2004, 02:17 PM
I am running the windows port of php and apache. (windows 2000)
Which probably complicates this issue further.
I have copies the php5apache2.dll file the php4ts.dll file and php.ini to my winnt\system32 directory
--Joshua

jammer42777
07-25-2004, 11:57 PM
Sorry to be some trouble, I ended up getting php working under MS IIS 4.0, sorry to have wasted your time (since I won't be using apache, at least in windows)

Take care and thank you very much for your willingness to help
--Joshua