Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

PHP Configuration

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

PHP Configuration

Postby OldManRiver » Wed Feb 09, 2005 7:51 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?
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Postby ruturajv » Wed Feb 09, 2005 7:38 pm

this becuase you have not configured Apache to handle php script

read php's install.txt (apache configuratiion)

you need to do

AddType and LoadModule directives....
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Actually

Postby OldManRiver » Thu Feb 10, 2005 12:01 pm

:? I actually have the following config in the httpd.conf file:

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
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Postby ruturajv » Thu Feb 10, 2005 7:16 pm

should be
Code: Select all
AddType application/x-httpd-php .php
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby OldManRiver » Fri Feb 11, 2005 7:09 am

8) What about these lines:

#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?
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

No Change

Postby OldManRiver » Fri Feb 11, 2005 7:24 am

:? Un commented and edited the line you replied about. Did a restart on Apache and checked again.

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
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Help

Postby OldManRiver » Fri Feb 18, 2005 6:38 pm

Can I get some help here?
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Postby ruturajv » Sun Feb 20, 2005 8:02 pm

hi,
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 ... :)
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Tested This

Postby OldManRiver » Fri Feb 25, 2005 11:38 am

: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!
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Postby swirlee » Fri Feb 25, 2005 12:44 pm

What version of Apache are you running? If you're running >2, try removing the AddHandler line.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Postby ruturajv » Sun Feb 27, 2005 3:20 am

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
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Re: Tested This

Postby WiZARD » Tue Mar 01, 2005 6:30 am

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
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Postby OldManRiver » Sun Mar 27, 2005 1:04 pm

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!
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Postby OldManRiver » Thu Mar 31, 2005 11:58 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
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Help!!!

Postby OldManRiver » Tue Apr 05, 2005 9:20 am

:help: :help:

Can I get some help here?
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

Postby Directrix » Tue Apr 05, 2005 3:34 pm

This should work:
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.
Directrix
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Nov 02, 2004 4:58 pm

Postby WiZARD » Wed Apr 06, 2005 5:46 am

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?
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Line 815

Postby OldManRiver » Wed Apr 06, 2005 8:51 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
OldManRiver
New php-forum User
New php-forum User
 
Posts: 17
Joined: Wed Feb 09, 2005 6:46 am

extension problem...

Postby Tendouji » Sun Jul 31, 2005 8:13 pm

I ve installed PHP that works fine with Apache n MySQL that works too...

However, when i uncomment the extension MySQL, everytime Apache restarts, it says unable to locate/find MySQL module.

I ve followed exactly wat the install.txt say... extension_dir is correctly specifying where my extensions are located. I even tried quotes, backlash n frontlash but it still says the same each time. IS there any other setting i missed out? I totally run out of idea here...
Tendouji
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sun Jul 31, 2005 7:56 pm

Postby Alexej Kubarev » Mon Aug 01, 2005 2:35 am

are you on Windows? in that case you might need to copy that dll file to Windows folder as well: or add a path to PHP folder into the PATH enviromental variable
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län


Return to PHP Installation

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.