PHP Configuration
Moderators: egami, macek, gesf
-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am
:shock: I think I have the PHP engine installed and working but can not tell. Somehow everytime I try to view a file, the browser (tried FireFox, NetScape and MSIE) thinks the file is a script or something and prompts for a "Download" instead of showing the page. When a page does show it does not interpret, but shows just text.
I went to the MS Explorer, looked at the Filetypes supported and found that .PHP is set to "PHP Script File" and assigned to open with the browser, but still cannot get the browser to work with the file.
The reason I know these files are good is I had them working before on/from a web site, but can't make them work with the Apache/PHP local host. I'm wondering if I still need a tweak or two on the Apache config.
Does anyone no the answer to my problem?
I went to the MS Explorer, looked at the Filetypes supported and found that .PHP is set to "PHP Script File" and assigned to open with the browser, but still cannot get the browser to work with the file.
The reason I know these files are good is I had them working before on/from a web site, but can't make them work with the Apache/PHP local host. I'm wondering if I still need a tweak or two on the Apache config.
Does anyone no the answer to my problem?
-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am

AddType text/html .htm .dhtml .html .shtml .php .xml
AddOutputFilter INCLUDES .dhtml .shtml .php
AddHandler server-parsed .dhtml .shtml .html .htm .xml .php
I used to have:
#AddType application/x-httpd-php php
#ScriptAlias /_php/ "E:\Program Files\PHP Server"
#ScriptAlias /php/ "E:\Program Files\PHP Server"
#AddType application/x-httpd-php "/_php/php.exe"
#AddHandler php-script .php
but it behaved so badly that I had to take it out. The path is correct, the files actully do exist on the "E:" drive. Should I assume that I do need a "ScriptAlias" but have the syntax wrong?
OMR
- ruturajv
- php-forum Super User
- Posts: 1279
- Joined: Sat Mar 22, 2003 9:42 am
- Location: Mumbai, India
- Contact:
should be
Code: Select all
AddType application/x-httpd-php .php
-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am

#ScriptAlias /_php/ "E:\Program Files\PHP Server"
#ScriptAlias /php/ "E:\Program Files\PHP Server"
#AddType application/x-httpd-php "/_php/php.exe"
#AddHandler php-script .php
I had a book on PHP (don't remember the title or author) that gave me those lines. They seemed to cause more problems than they solved. Should I use any of them?
-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am

I even have a test.html file I am testing with which is:
<html>
<body>
<?
phpinfo();
?>
</html>
<?
echo <h1><b>It works!</b></h1>
<br>test again!
phpinfo();
?>
</body>
</html>
All it shows in the "It works!" in bold and all that follows shows as text.
I think one of the ScriptAlias lines (maybe both) is needed to actually call the PHP engine, but I don't know what actual syntax to use.
I'm wondering if:
ScriptAlias /.php/ "E:\Program Files\PHP Server"
ScriptAlias .php/ "E:\Program Files\PHP Server"
is what it is looking for?
OMR
-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am
Can I get some help here?
- ruturajv
- php-forum Super User
- Posts: 1279
- Joined: Sat Mar 22, 2003 9:42 am
- Location: Mumbai, India
- Contact:
hi,
please check on the following points
first check on those....
still if you have a problem,,,, help is a post away ...
please check on the following points
- Check for your php4ts.dll file location (read the php INSTALL.txt)
- Check for the LoadModule and AddModule configuration in Apache (read the php INSTALL.txt for Apache Configuration as shared module)
- Check the AddType configuration for Apache (read the php INSTALL.txt for Apache Configuration as shared module)
first check on those....
still if you have a problem,,,, help is a post away ...

-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am

# Server Side Processing Configuration
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .htm .dhtml .html .shtml .php .xml
AddOutputFilter INCLUDES .dhtml .shtml .php
AddHandler server-parsed .dhtml .shtml .html .htm .xml .php
# Enable the PHP Server
#LoadModule php4_module "E:\Program Files\PHP Server\php.exe"
#LoadModule php4_module "E:\Program Files\PHP Server\php4ts.dll"
#LoadModule php4_module "E:\Program Files\PHP Server\sapi\php4apache.dll"
#AddModule mod_php4.c
AddHandler php-script .php
AddType application/x-httpd-php .php
#AddType application/x-httpd-php "/_php/php.exe"
#ScriptAlias /_php/ "E:\Program Files\PHP Server\php.exe"
#ScriptAlias /php/ "E:\Program Files\PHP Server\php.exe"
#ScriptAlias /._php/ "E:\Program Files\PHP Server\php.exe"
#ScriptAlias /.php/ "E:\Program Files\PHP Server\php.exe"
I ran the "php.exe -i" test from the Install.txt file. It ran OK
Then as I added the "LoadModule" and "AddModule" commands, one at a time,
running "RESTART" after each; I got errors on each.
If you can explain the relationship, dependencies, etc., which I cannot find
in any books or help files, then maybe debugging will be easier. Right now
I'm clueless!
- ruturajv
- php-forum Super User
- Posts: 1279
- Joined: Sat Mar 22, 2003 9:42 am
- Location: Mumbai, India
- Contact:
AddHandler server-parsed .dhtml .shtml .html .htm .xml .php
why are you adding server-parsed handler to php...
it should be separate...
remove that .php handler
then use LoadModule, AddModule, AddType...
and then check
- WiZARD
- Moderator
- Posts: 1240
- Joined: Thu Jun 20, 2002 10:14 pm
- Location: Ukraine, Crimea, Simferopol
- Contact:
OldManRiver wrote::help: First so you will know here are all the commands in my config file:
# Server Side Processing Configuration
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .htm .dhtml .html .shtml .php .xml
AddOutputFilter INCLUDES .dhtml .shtml .php
AddHandler server-parsed .dhtml .shtml .html .htm .xml .php
# Enable the PHP Server
#LoadModule php4_module "E:\Program Files\PHP Server\php.exe"
#LoadModule php4_module "E:\Program Files\PHP Server\php4ts.dll"
#LoadModule php4_module "E:\Program Files\PHP Server\sapi\php4apache.dll"
#AddModule mod_php4.c
AddHandler php-script .php
AddType application/x-httpd-php .php
#AddType application/x-httpd-php "/_php/php.exe"
#ScriptAlias /_php/ "E:\Program Files\PHP Server\php.exe"
#ScriptAlias /php/ "E:\Program Files\PHP Server\php.exe"
#ScriptAlias /._php/ "E:\Program Files\PHP Server\php.exe"
#ScriptAlias /.php/ "E:\Program Files\PHP Server\php.exe"
I ran the "php.exe -i" test from the Install.txt file. It ran OK
Then as I added the "LoadModule" and "AddModule" commands, one at a time,
running "RESTART" after each; I got errors on each.
If you can explain the relationship, dependencies, etc., which I cannot find
in any books or help files, then maybe debugging will be easier. Right now
I'm clueless!
try this:
# First load PHP as module
LoadModule php4_module "E:\Program Files\PHP server\sapi\php4apache.dll
# or
# LoadModule php4_module "E:\Program Files\PHP server\sapi\php4apache2.dll
# for apache 2.0.x
# Second, PHP extension initialization
AddType application/x-httpd-php .php
# And only after that add handler
AddHandler php-script .php
P.S.
Then Apache start it's like BASIC interpretetor read each string from top to down.
and once more remove PHP from this line: AddType text/html .htm .dhtml .html .shtml .php .xml
cuz Apache first think what php extension is simple HTML file
Good luck
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";


-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am
I never got errors before now with the code:
LoadModule php4_module "E:\Program Files\PHP Server\sapi\php4apache.dll"
AddType application/x-httpd-php .php
AddHandler php-script .php
I'm getting this error:
Syntax error on line 815 of E:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
Cannot load E:/Program Files/PHP Server/sapi/php4apache.dll into server: One of
the library files needed to run this application cannot be found.
Sorry I'm so clueless on this!
LoadModule php4_module "E:\Program Files\PHP Server\sapi\php4apache.dll"
AddType application/x-httpd-php .php
AddHandler php-script .php
I'm getting this error:
Syntax error on line 815 of E:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
Cannot load E:/Program Files/PHP Server/sapi/php4apache.dll into server: One of
the library files needed to run this application cannot be found.
Sorry I'm so clueless on this!
-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am
So what am I missing here? I'm clueless, as I still have not idea or understanding of intedepencies and operational modes, so need the help.
Thanks in advance!
OMR
Thanks in advance!
OMR
-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am


Can I get some help here?
This should work:
If PHP is not installed in C:/PHP, just change the code so it points to the correct directory.
Code: Select all
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
If PHP is not installed in C:/PHP, just change the code so it points to the correct directory.
- WiZARD
- Moderator
- Posts: 1240
- Joined: Thu Jun 20, 2002 10:14 pm
- Location: Ukraine, Crimea, Simferopol
- Contact:
OldManRiver wrote:I never got errors before now with the code:
LoadModule php4_module "E:\Program Files\PHP Server\sapi\php4apache.dll"
AddType application/x-httpd-php .php
AddHandler php-script .php
I'm getting this error:
Syntax error on line 815 of E:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
Cannot load E:/Program Files/PHP Server/sapi/php4apache.dll into server: One of
the library files needed to run this application cannot be found.
Sorry I'm so clueless on this!
What exactly on the page 815?
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";


-
- New php-forum User
- Posts: 19
- Joined: Wed Feb 09, 2005 6:46 am
What it is referring to is Line (not page) 815, which is:
LoadModule php4_module "E:\Program Files\PHP Server\sapi\php4apache.dll"
in the Apache Config file.
I'm thinking the real errors are in the PHP config file, but not sure. The previous persons helping me had me change the PHP config file as well, so thinking that is the source of the problem.
Do you know?
OMR
LoadModule php4_module "E:\Program Files\PHP Server\sapi\php4apache.dll"
in the Apache Config file.
I'm thinking the real errors are in the PHP config file, but not sure. The previous persons helping me had me change the PHP config file as well, so thinking that is the source of the problem.
Do you know?
OMR
- Alexej Kubarev
- Site Admin
- Posts: 2213
- Joined: Fri Mar 05, 2004 7:15 am
- Location: Täby, Stockholms län
- Contact: