Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache and PHP

Status
Not open for further replies.

sjaakdelul

IS-IT--Management
Sep 19, 2002
43
NL
Hey,

I've installed apache and php.
Apache is working very good, but php not ...
I hope you can help me to configure it to a good way.

I've done the follow steps:

In apache:
ServernameAdmin = themarti_m@hotmail.com
ServerName = 213.93.xxx.xx (my ip-adress)


Added/changed the lines:


DocumentRoot "C:\WebServer\test"


Added/changed the lines:

#
# 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:/WebServer/Apache Group/Apache2/cgi-bin/"
ScriptAlias /php/ "C:/php-4.2.2-win32/"



Added/changed the lines:

#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .phtml .php
AddType application/x-httpd-php-source .phps



Added/changed the lines:

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action application/x-httpd-php /php/php.exe


That's what I've changed in httpd.conf.




In php.ini, I've changed the follow lines:

-In the PHP installation directory, find the php.ini-dist file and rename it to php.ini.

-Move the php.ini file to C:\WINDOWS\.

-Move the php4ts.dll file to C:\WINDOWS\SYSTEM\32


-register_globals = On

-doc_root = "C:\WebServer\test"

-extension_dir = "C:\WebServer\php-4.2.2-Win32\extensions"

-cgi.force_redirect = 0

What can be wrong?
Why does php don't work?

Thx
 
In the post above, IE6 explorer siad he couldn't find the file. But it was there ...



Now, I've setup httpd.conf again and install php as module instead of cgi in the post above...

The changes are:

Added/changed the lines:

#
# 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:/WebServer/Apache Group/Apache2/cgi-bin/"




Added/changed the lines:

#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php-source .phps
#
# PHP
#
AddType application/x-httpd-php .phtml .php .php3 .php4




Added/changed the lines:

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#



He can find the file infophp.php now.
The problem is that IE6 explorer want to download the file and not to runthe file ...


Who knows more about my problem. Apache is working, but php not. Which changes I should make in httpd.conf as cgi or module (i'f both the httpd.conf files) ??
 
Ok, it's working now.
I forgot to remove the php.ini file in the php directory ... This file was conflicting with the php.ini file in the directory windows.

Thx 4 all
 
I'm facing the same problem
Apache is running fine until i write the following lines the httpd.conf file.

LoadModule php4_module "D:/PHP/sapi/php4apache.dll"
Addmodule mod_php4.c
AddType application/x-httpd-php .php

ScriptAlias /php/ "D:/PHP/"
Action application/x-httpd-php /php/php.exe

I've also changed the following line in the php.ini file

doc_root = C:\Program Files\Apache Group\Apache2\htdocs

But the Apache server ends as soon as it starts. I dont know what is happening. Please help me?

Furqan
 
try adding the 2 to the line

LoadModule php4_module "D:/PHP/sapi/php4apache[red]2[/red].dll"

i noticed that php has both in the sapi folder Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top