Re: PHP5 IIS Setup

From: Andy Hassall (andy_at_andyh.co.uk)
Date: 02/28/04


Date: Sat, 28 Feb 2004 22:42:51 +0000

On Sat, 28 Feb 2004 22:11:06 GMT, "Kill_Jarrod" <kiley@thecrook.com> wrote:

[ Top-posting corrected, see later in message ]

>>> I can't seem to set up PHP5 to work on IIS (or Apache, for that
>>> matter). I have configured the php.ini file(the redirect line) and I have added
>>> the isapi dll. But when I open a page on my server, it does not display the php but
>>> rather the php source code (as if looking at the page by opening up the local
>>> .htm file, instead of through the server http://localhost/somepage.php ). Am I
>>> missing some steps here??
>>
>> Please don't post HTML. Please don't top-post.
>>
>> If you go step by step through what you did, that would help in trying to
>> point out what you may have missed.
>
>p.s.
>(I did not post using HTML. If there were any html tags, OutlookExpress
>must have
>added them.

 It had an HTML attachment. Make sure all your settings are set to Plain Text
and not HTML. Outlook Express has a nasty habit of defaulting to HTML.

> In regards to "Please don't top post"...I don't know what that
>is. This is the first newsgroup I have ever posted to (no, I'm not joking).

 Top posting is posting a reply on top of the question. The preferred way of
replying is to cut the original post(s) down to the relevant minimum, and then
put your replies to parts of the message after the relevant part of the
message, like this. Search for 'top posting' on www.google.com for endless
discussions.

 Also have a look through this page:

 http://www.catb.org/~esr/faqs/smart-questions.html

 It's pretty condescending in places, but gives you a good head start in how to
post in a way that is more likely to get useful replies.

>Thanks again for any help anyone can offer.

 OK, back to the matter at hand. Time I tried the new beta anyway, so I'm going
through the install process myself and seeing where we differ.

>Ok, here are all the nasty details:
>
>1. Downloaded PHP 5.0.0b4 zip package
>2. Unzipped it to a new directory, C:\php5
>3. Copied the new php.ini file to C:\WINNT\

 OK - there's also the PHPRC environment variable you can use to avoid copying
stuff into the Windows system directories, but this is fine for starters.

>4. Configured apache httpd.conf (LoadModule php5_module
>C:\php5\php5apache.dll)

 Hm, I see they've rearranged the directory structure; this used to be in the
sapi subdirectory. But looks OK.

> also tried (LoadModule php4_module C:\php5\php5apache.dll).
>5. Apache would not start, had the following error:
> "Cannot load C:/php5/php5apache.dll into server: The specified module
>could not be found."

 OK, you've missed several steps. You've forgotten to copy php5ts.dll to
somewhere where php5apache.dll can be found. This is mentioned in the
install.txt file - did you read this?

 Copy php5ts.dll to C:\WINNT\system32. Maybe not the neatest way, but it works.

 Incidentally I'm using Apache 2, so I'm using php5apache2.dll. You haven't
stated an Apache version - php5apache.dll is suitable only for Apache 1.3.x.

 You haven't added a type association so Apache knows to use PHP to process
.php files; once your server has started up, this is the most likely cause of
it not processing PHP files (it won't unless you tell it to!). You need to add
to httpd.conf:

AddType application/x-httpd-php .php

 After that, it works fine here.

>Then I tried it using IIS:
>1. Added ISAPI Filter php5isapi.dll
>2. Edited php.ini ( cgi.force_redirect = 0)
>
>IIS Starts with the filter in place, but it shows the php source code.

 Personally I'd stick to Apache.

-- 
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>


Relevant Pages

  • Re: Content negotiation in Apache
    ... >Someone already mentioned the rewriting rules which will work for you. ... Sorry I hadn't posted anything in awhile, but Apache and I move ... The other is that I'm learning PHP and did not originally have the ... and got 600 visitors this December, and the page ends in ".html" and now ...
    (RedHat)
  • Re: Redirecting between PHP Pages
    ... Display login form ... >>other php files, you should never need a redirect your page except to ... pass it on to smarty which then displays it as html for me. ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... Surely a dynamic web server should appear exactly the same as a static one - all files that contain HTML when viewed should be called ... If you know how, say, the PHP apache module works, you'll see that the hit is ... Apache was designed to do just this. ...
    (comp.lang.php)
  • Re: Templates & PHP files
    ... Here's a link that explains how to make PHP function on an htm/ html page: ... > have added many PHP files to update my databases. ... > Problem is, whenever I make a change to a template, it only updates the ...
    (microsoft.public.frontpage.programming)
  • Re: Convert from .html to .php - What are SEO implications of file name changes?
    ... you can leave all your pages as .html and any embedded PHP ... I think we are using Apache, so I'll try your suggestion if we are. ... And while we are on the subject of Apache, .htaccess, etc, are there ...
    (alt.internet.search-engines)