I had installed PHP onto my server a while back and it was working fine. But then I started messing with the ini file and now it won't work! I tried to reinstall it using installation instructions I found on the net, but there are too many different suggestions out there on how to install.

Now I get a HTTP 500 - Internal server error when I try to run my info.php page (or any other php page for that matter). Which I guess is progress since before I reinstalled I was getting Page Not Found errror...

Any suggestions on how to install properly?

Thanks.

    Why not just download the eindows installer version of PHP for your IIS and it will properly install it for you with a few prompts, where just accept the defaults and it should work when completed.

      Or just get a real webserver like Apache and install PHP as an ISAPI module... 'tis easy if you follow the instructions on the PHP man page ([man]install.windows.apache1[/man] or [man]install.windows.apache2[/man] depending on which version of Apache you install).

      If you want to keep IIS, and can't get PHP fixed, let me know and I can walk you through how to setup PHP manually as an ISAPI module in IIS... just let me know which version of IIS you're running.

        I must agree with Brad I used IIS a few years ago and really didn't like it and then got Apache and have never since used IIS. Just because it come with your Windows install does not mean you have to use it.

          bradgrafelman wrote:

          Or just get a real webserver like Apache and install PHP as an ISAPI module... 'tis easy if you follow the instructions on the PHP man page ([man]install.windows.apache1[/man] or [man]install.windows.apache2[/man] depending on which version of Apache you install).

          If you want to keep IIS, and can't get PHP fixed, let me know and I can walk you through how to setup PHP manually as an ISAPI module in IIS... just let me know which version of IIS you're running.

          Unfortunately, I have to use what is already on the server, which is IIS (until I can convince my mgmnt. to switch it). So yes, if you could tell me what I need to do to get PHP running that would be WONDERFUL! THANKS!!!

            Visit the man page [man]install.windows.iis[/man] and scroll until you see "To use the ISAPI modlue, do the following:" . I recommend using this ISAPI module over the CGI binary.

            If you do decide to use the ISAPI module, and can't understand the steps in the manual, let me know and I can walk you through it step by step (at least, for IIS 6... since you're running Server 2k3, I'm going to assume it's IIS 6).

              bradgrafelman wrote:

              Visit the man page [man]install.windows.iis[/man] and scroll until you see "To use the ISAPI modlue, do the following:" . I recommend using this ISAPI module over the CGI binary.

              If you do decide to use the ISAPI module, and can't understand the steps in the manual, let me know and I can walk you through it step by step (at least, for IIS 6... since you're running Server 2k3, I'm going to assume it's IIS 6).

              I followed the steps (they seemed easy enough), but still NOTHING. I try to fun my phpinfo.php file and still get a HTTP 500 - Internal server error.

              Got anything? Thanks.

                Okay, here's a rough how-to that I use to install PHP in IIS 6... feel free to skip over steps you're positive you've already done (correctly)...

                1. On the directory that you installed PHP in (D:\php\ for me), make sure that either:
                     a. "Everyone" or a group that contains the IUSR_ComputerName account has Read & Execute permissions (giving it Full Control would definitely do the job)
                     b. You specifically add the IUSR_ComputerName account to the ACL (properties of PHP folder, Security tab) and give it full control. To make sure this applies to everything inside, before you hit apply & OK on the properties window, click on the Advanced button (off of the Security tab) and choose the second box "Replace permission entries on all child objects..."
                2. I don't remember my reasoning, but I coped the php4isapi.dll into the root of the PHP installation folder (i.e. from D:\php\sapi\ to D:\php\)... couldn't hurt at any rate.
                3. In IIS Manager, open up Web Service Extensions and add a new extension. The name can be something like PHP, and for the required files, click the add button and browse to the ISAPI .dll (D:\php\php4isapi.dll for me). Make sure you tick the "Set extension status to Allowed" checkbox in that dialog before you hit OK.
                4. Expand the "Web Sites" folder in IIS Manager, and go to the properties of your site (if you have multiple sites... repeat these steps for each site).
                     a. On the ISAPI filters tab, click Add. Again, filter name can be something simple like PHP. The Executable field should again be the same path to the .dll as above. Then hit OK.
                     b. On the Home Directory tab, make sure "Execute permissions" is set to Scripts only. If Application pool is something other than DefaultAppPool... tell me what it says.
                     c. On that same tab, click the configuration button located to the right of the Execute permissions drop-down.
                          i. Click the Add button, and type in .php for the extension. Executable... recognize that? ;) Browse to the same .dll once again.
                          ii. Make sure you leave Verbs to All verbs.
                          iii. Make sure both checkboxes at the bottom are ticked, and hit OK.
                          iv. On the mappings tab, my webserver has "Cache ISAPI extensions" checked. Couldn't hurt... unless you're running out of RAM/CPU or something.
                          v. Hit OK again
                     d. Hit OK on the properties screen.
                5. ***RESTART IIS***
                6. That should be it!
                  bradgrafelman wrote:

                  Okay, here's a rough how-to that I use to install PHP in IIS 6... feel free to skip over steps you're positive you've already done (correctly)...

                  1. On the directory that you installed PHP in (D:\php\ for me), make sure that either:
                       a. "Everyone" or a group that contains the IUSR_ComputerName account has Read & Execute permissions (giving it Full Control would definitely do the job)
                       b. You specifically add the IUSR_ComputerName account to the ACL (properties of PHP folder, Security tab) and give it full control. To make sure this applies to everything inside, before you hit apply & OK on the properties window, click on the Advanced button (off of the Security tab) and choose the second box "Replace permission entries on all child objects..."
                  2. I don't remember my reasoning, but I coped the php4isapi.dll into the root of the PHP installation folder (i.e. from D:\php\sapi\ to D:\php\)... couldn't hurt at any rate.
                  3. In IIS Manager, open up Web Service Extensions and add a new extension. The name can be something like PHP, and for the required files, click the add button and browse to the ISAPI .dll (D:\php\php4isapi.dll for me). Make sure you tick the "Set extension status to Allowed" checkbox in that dialog before you hit OK.
                  4. Expand the "Web Sites" folder in IIS Manager, and go to the properties of your site (if you have multiple sites... repeat these steps for each site).
                       a. On the ISAPI filters tab, click Add. Again, filter name can be something simple like PHP. The Executable field should again be the same path to the .dll as above. Then hit OK.
                       b. On the Home Directory tab, make sure "Execute permissions" is set to Scripts only. If Application pool is something other than DefaultAppPool... tell me what it says.
                       c. On that same tab, click the configuration button located to the right of the Execute permissions drop-down.
                            i. Click the Add button, and type in .php for the extension. Executable... recognize that? ;) Browse to the same .dll once again.
                            ii. Make sure you leave Verbs to All verbs.
                            iii. Make sure both checkboxes at the bottom are ticked, and hit OK.
                            iv. On the mappings tab, my webserver has "Cache ISAPI extensions" checked. Couldn't hurt... unless you're running out of RAM/CPU or something.
                            v. Hit OK again
                       d. Hit OK on the properties screen.
                  5. ***RESTART IIS***
                  6. That should be it!

                  Followed all of those instructions and what I ran into was when I did step 4 A (add PHP to ISAPI filters), my web services stopped working. I couldn't even get my generic localhost page. I went in and checked that tab again and it shows a down red arrow under Status, PHP under Filter Name and Unknown under Priority. I removed the entry and the services began working again. Of course not the PHP pages though!

                  WHAT am I missing???

                  Thanks!

                    Hmm. Did you use the browse button to file the .dll file instead of just typing in the path? Are you positive you chose "php4isapi.dll" ?

                    Also, did you do the permissions step before this?

                      bradgrafelman wrote:

                      Hmm. Did you use the browse button to file the .dll file instead of just typing in the path? Are you positive you chose "php4isapi.dll" ?

                      Also, did you do the permissions step before this?

                      Yes, I browsed to the file. And I am using php5isapi.dll. Would that make a difference?

                      And yes, the permissions are set to my php folder under C:/php.

                      Anything else I might be missing?

                        Sorry... I'm clueless. Now, I've never installed PHP 5, though one would think it installs in the same manner?

                        Just to make sure, can you try copying all of the DLLs from C:\php\dlls\ to some place in your system's PATH variable... C:\windows\system32\ is a safe bet.

                        Then, re-add the PHP ISAPI filter and restart IIS. Any luck?

                        EDIT: Also, try moving your php.ini file to C:\windows. You do have a php.ini file all configured up, right?

                          Nope, no luck... I don't understand why this won't work, since it was working at one time... If I downloaded the files again, would I just delete the current php folder I have, or are there other files else where that I should remove?

                            Nope, PHP folder is all.

                            Well, except for the .dll's copied to the system32 folder.

                            EDIT: Also, until we can get it up and running, I would comment out all extension= lines in the php.ini file to rule out any dependency as being the culprit.

                              Write a Reply...