I got a problem with Apache & PHP.

This is a discussion on I got a problem with Apache & PHP. within the Apache Web Server forums, part of the Web Server and Related Forums category; First off, I'm trying to get PHP working with Apache. I added this line to my httpd.conf: AddType ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-17-2003
Louis
 
Posts: n/a
Default I got a problem with Apache & PHP.

First off, I'm trying to get PHP working with Apache.
I added this line to my httpd.conf: AddType application/x-httpd-php .php
and I have set index.php to the default index page.

When I go to my test page (index.php) with a little <? print(Date("l F d,
Y")); ?> on it,
both Opera and Explorer try to open it as an application and ask me where I
want to save it.
They doesn't seem to recognize it well.

Any hints? Thank's for reading.

- Louis S.


  #2 (permalink)  
Old 07-17-2003
The Other Guy
 
Posts: n/a
Default Re: I got a problem with Apache & PHP.

On Thu, 17 Jul 2003 12:50:53 -0400, The Other Guy responded to a post
from "Louis" <what@ever.ca> who wrote in alt.apache.configuration:

>First off, I'm trying to get PHP working with Apache.
>I added this line to my httpd.conf: AddType application/x-httpd-php .php
>and I have set index.php to the default index page.
>
>When I go to my test page (index.php) with a little <? print(Date("l F d,
>Y")); ?> on it,
>both Opera and Explorer try to open it as an application and ask me where I
>want to save it.
>They doesn't seem to recognize it well.
>
>Any hints? Thank's for reading.
>
>- Louis S.
>


You haven't configured something properly. What O/S are you using?
Which version of Apache? Which version of PHP? All of these bits of
info would be useful to help as each version of Apache, and PHP
versions, as well as the O/S have their own set up and config.


--
../configure --prefix=~/zyterion
Not this guy or that guy, The Other Guy.

This spot may contain a satirical comment or comedic source,
and is meant to be funny. If you are easily offended, gullible
or don't have a sense of humour we suggest you read elsewhere.
  #3 (permalink)  
Old 07-17-2003
Dave
 
Posts: n/a
Default Re: I got a problem with Apache & PHP.

Louis wrote:
> First off, I'm trying to get PHP working with Apache.
> I added this line to my httpd.conf: AddType application/x-httpd-php .php
> and I have set index.php to the default index page.
>
> When I go to my test page (index.php) with a little <? print(Date("l F d,
> Y")); ?> on it,
> both Opera and Explorer try to open it as an application and ask me where I
> want to save it.
> They doesn't seem to recognize it well.
>
> Any hints? Thank's for reading.
>
> - Louis S.
>
>

You also need to add a .htaccess file in your base directory, containing

DirectoryIndex index.shtml index.php

in order to advise Apache that if index.shtml (or .html) is not existing
the index.php would become the entry file of your website

  #4 (permalink)  
Old 07-17-2003
Justin Koivisto
 
Posts: n/a
Default Re: I got a problem with Apache & PHP.

Dave wrote:

> Louis wrote:
>
>> and I have set index.php to the default index page.
>>

> You also need to add a .htaccess file in your base directory, containing
>
> DirectoryIndex index.shtml index.php
>
> in order to advise Apache that if index.shtml (or .html) is not existing
> the index.php would become the entry file of your website
>


Isn't that what he said he did?

--
Justin Koivisto - spam@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

  #5 (permalink)  
Old 07-19-2003
Al Vazquez
 
Posts: n/a
Default Re: I got a problem with Apache & PHP.

Louis wrote:
> First off, I'm trying to get PHP working with Apache.
> I added this line to my httpd.conf: AddType application/x-httpd-php .php
> and I have set index.php to the default index page.
>
> When I go to my test page (index.php) with a little <? print(Date("l F d,
> Y")); ?> on it,
> both Opera and Explorer try to open it as an application and ask me where I
> want to save it.
> They doesn't seem to recognize it well.
>
> Any hints? Thank's for reading.
>
> - Louis S.
>
>

I just went through this myself. You also need to add this line to your

httpd.conf AddHandler application/x-httpd-php .php .phtml

The handler line is omitted from the Apache documentation for some
reason, but it's somewhere in the PHP documentation. That should fix
it. Keep us informed on how you're doing.

-A.V.

  #6 (permalink)  
Old 07-21-2003
Jim Gerland
 
Posts: n/a
Default Confiure Apache & PHP on an AS400?

I'm trying to configure Apache on an IBM iSeries 270 running OS400 V5R1 with
PHP 4.3 and I can't get it to recognize .php (or .pl for perl files either).
Here is the relavent part of my apache httpd.conf file:

AddHandler application/x-httpd-perl .cgi .pl
AddHandler application/x-httpd-php .php .phtml
ScriptAlias /perl-bin /QOpenSys/perl/bin/
AddType application/x-httpd-perl .pl
AddType application/x-httpd-perl .cgi
Action application/x-httpd-perl /perl-bin/perl
<Directory /QOpenSys/perl/bin>
Options +ExecCGI +FollowSymLinks +MultiViews +Indexes
Order Allow,Deny
allow from all
</Directory>
ScriptAlias /php-bin /QOpenSys/php/bin/
AddType application/x-httpd-php .php
Action application/x-httpd-php /php-bin/php
<Directory /QOpenSys/php/bin>
Options +ExecCGI +FollowSymLinks +MultiViews +Indexes
Order Allow,Deny
allow from all
</Directory>

Any ideas or pointer to how to configure apache on an AS400 would be greatly
appreciated.
Thanks,
Jim....


  #7 (permalink)  
Old 07-21-2003
The Other Guy
 
Posts: n/a
Default Re: Confiure Apache & PHP on an AS400?

On Mon, 21 Jul 2003 12:39:31 -0400, The Other Guy responded to a post
from "Jim Gerland" <jgerland@willcare.com> who wrote in
alt.apache.configuration:

>I'm trying to configure Apache on an IBM iSeries 270 running OS400 V5R1 with
>PHP 4.3 and I can't get it to recognize .php (or .pl for perl files either).
>Here is the relavent part of my apache httpd.conf file:
>
>AddHandler application/x-httpd-perl .cgi .pl
>AddHandler application/x-httpd-php .php .phtml
>ScriptAlias /perl-bin /QOpenSys/perl/bin/


s/b ScriptAlias /perl-bin/ /QOpenSys/perl/bin/
note trailing slash at the end of the nickname -- if one ends with a
trailing slash, the other should as well.


Technically, the AddHandlers here are irrelevant because you are
using ScriptAlias


>AddType application/x-httpd-perl .pl
>AddType application/x-httpd-perl .cgi


Could use one line:
AddType application/x-httpd-perl .pl .cgi

>Action application/x-httpd-perl /perl-bin/perl
><Directory /QOpenSys/perl/bin>
> Options +ExecCGI +FollowSymLinks +MultiViews +Indexes
> Order Allow,Deny
> allow from all
></Directory>


s/b Options +FollowSymLinks +MultiViews +Indexes
don't need +ExecCGI because it is redundant -- ScriptAlias makes all
files in the named directory executable by default.

>ScriptAlias /php-bin /QOpenSys/php/bin/


add trailing slash -- see above.

>AddType application/x-httpd-php .php


Try adding:
AddType application/x-httpd-php-source .phps
but can't say that will be effective.

With the above AddType, only files with the extension .php with be
processed by the PHP interpreter.

>Action application/x-httpd-php /php-bin/php
><Directory /QOpenSys/php/bin>
> Options +ExecCGI +FollowSymLinks +MultiViews +Indexes
> Order Allow,Deny
> allow from all
></Directory>


s/b Options +FollowSymLinks +MultiViews +Indexes
see notes above.

>Any ideas or pointer to how to configure apache on an AS400 would be greatly
>appreciated.
>Thanks,
>Jim....


I can give you the above advice only. It has been literally several
years since I did any work at all with an AS400. Have you tried to
implement them as modules as opposed to CGI?

Make sure that there are no AllowOverrides being inherited from parent
directories.

Try making the changes I suggested to see if that helps any.

Regards,
TOG

--
../configure --prefix=~/zyterion
Not this guy or that guy, The Other Guy.

"If you're not thoroughly confused by now, then you just
don't understand the situation."
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:40 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0