« Previous Next »

Answered Thread: PHP won't work after I followed the install and configure instructions

Last post 11-25-2009 3:01 PM by miller2j. 27 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (28 items) 1 2 Next >

Sort Posts:

  • 11-02-2009, 1:56 PM

    PHP won't work after I followed the install and configure instructions

    Hi,

    I am trying to get PHP installed and running on a windows server (2003), and it's just not working. I downloaded the latest PHP windows installer from windows.php.net, and then installed the FastCGI module for IIS from iis.net. I followed the straight-forward instructions in the learn section, and everything went through without a problem. I visually verified the settings, and saw that php is now a valid extension for the web server. However, after restarting IIS, I can't get a php page to load.


    I just write a simple phpinfo() file called test.php and placed it in an existing ASP.Net website. You can try here: http://www.vuewireless.com/test.php and see that absolutely nothing interesting happens.

    If I followed the instructions, and then visually verified the settings in IIS, why won't it work? 

    Note: I'm a PHP developer for the Linux platform, so I've never done this before. That being said, I don't see any reason why the straight-forward instructions didn't produce the desired result. Any help/advice would be appreciated.


    Thanks,
    Caleb

  • 11-02-2009, 2:12 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: PHP won't work after I followed the install and configure instructions

    Hi Caleb.

    I think script map is not setup properly and fastcgi handler is not really picking php requests. Easiest way to fix this problem would be to uninstall fastcgi, uninstall php and this time install fastcgi first and then php. PHP installer can detect presence of IIS FastCGI handler and configure it properly for you. Let us know how that goes.

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 11-02-2009, 2:13 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    calebrogers:
    If I followed the instructions, and then visually verified the settings in IIS, why won't it work? 

    Either you, or the instructions, were incorrect.

    calebrogers:
    Note: I'm a PHP developer for the Linux platform, so I've never done this before. That being said, I don't see any reason why the straight-forward instructions didn't produce the desired result.

    I guess you never read a MAN page...  :)

    You don't give any details which would allow us to provide relevant help.  We don't even know if a plain HTML page will work on your site.  Or if a PHP script can be run at the command line.  Or what the log files show  Or what code you used on your page. Or...  You get the idea.

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 11-02-2009, 3:43 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

     @ksingla

    OK, I uninstalled and resinstalled in the order you suggested, and I did get a slightly different result. Now, instead of nothing happening, I get a page not found error. This is odd because I can navigate right to that directory and see the file there. Everything else works just fine on the server, as this is an existing production server, but something is clearly wrong with how I'm setting up PHP.

    I followed the steps here:

    http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60

    and used the scripting option. The first time I went through this, it all behaved as expected, and all the settings appeared correct. After reinstalling and testing my phpinfo() script (test.php, mentioned before), and getting the error, I tried running the script again. It tells me that PHP is already added.

    I don't set up windows servers, so this is totally new to me. Any other ideas?

     

    Thanks,
    Caleb

  • 11-02-2009, 3:50 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: PHP won't work after I followed the install and configure instructions

    I tried sending request to http://www.vuewireless.com:80/test.php and got a 301. Is the test.php URL valid? Also can you turn off friendly http errors in internet explorer and paste the exact error message you got?

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 11-02-2009, 5:28 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    Hi,

    Can you please run both the commands below in a command window and paste the result here:

    cscript.exe C:\inetpub\AdminScripts\adsutil.vbs GET w3svc/DefaultDoc

    cscript.exe C:\inetpub\AdminScripts\adsutil.vbs GET w3svc/ScriptMaps | findstr php

    Also run

    C:\Program Files\PHP\php-cgi.exe <path to simple PHP test page>

    and paste the output.

    Also if possible please uninstall whatever you have done and follow the blog at http://blogs.iis.net/donraman/archive/2009/10/07/installing-php-on-windows.aspx.

    Hope this helps.

    Thanks,

    Don.

  • 11-19-2009, 3:02 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    Don,

    I have have spent several days working on getting php running on windows XP and iis 5.1.  I have tried the php MSI auto install and the manual install and have now tried the WPI install and still nothing.  When i run the test.php i get Error "The specified module could not be found".  so i found this forum and i'm asking for some help. here is the output from the post above


    . Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\jamie>cscript.exe C:\inetpub\AdminScripts\adsutil.vbs
    GET w3svc/DefaultDoc
    Microsoft (R) Windows Script Host Version 5.7
    Copyright (C) Microsoft Corporation. All rights reserved.

    DefaultDoc                      : (STRING) "Default.htm,Default.asp,index.htm,in
    dex.php"

    C:\Documents and Settings\jamie>cscript.exe C:\inetpub\AdminScripts\adsutil.vbs
    GET w3svc/ScriptMaps | findstr php
      ".php,C:\WINDOWS\system32\inetsrv\fcgiext.dll,5,GET,HEAD,POST"

    here ia the test file and the url

     <?php
    phpinfo();
    ?>

    http://137.229.80.178/unnamed/test.php

     

    thanks in advance

    jamie

  • 11-19-2009, 3:22 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    Hi Jamie,

    Can you follow my blog post on troubleshooting at http://blogs.iis.net/donraman/archive/2009/11/15/troubleshooting-php-installation-on-windows.aspx.

    Thanks,

    Don.

  • 11-19-2009, 3:53 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

     thanks for the quick reply

    it seems to be working from the command line i had not tried that before, but i still get the error

    "The specified module could not be found"  in the browser.

     

      IIS is working because other sites are working.

     

    thanks again

  • 11-19-2009, 3:57 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    Hi,

    Do you have all the DLL/EXE present? I mean FastCGI dll etc.

    Also run PHP from command line like:

    C:\Program Files\PHP\php-cgi.exe -c C:\Program Files\PHP -v and ensure that it's loading fine without cribbing about any missing DLL. I am assuming your PHP is installed at C:\Program Files\PHP.

    Thanks,

    Don.

  • 11-19-2009, 3:59 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    Hi,

    Also look at directory 'C:\WINDOWS\system32\inetsrv' (I am assuming that C: is your system drive) and ensure that you have:

    • fcgiext.dll
    • fcgiext.ini

    Open the fcgiext.ini file and see if things are proper. A properly set INI file should ideally have:

    [Types]
    php=PHP

    [PHP]
    ExePath=C:\Program Files\PHP\php-cgi.exe
    InstanceMaxRequests=10000
    ActivityTimeout=600
    RequestTimeout=600
    EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\Program Files\PHP\

    Ensure that C:\Program Files\PHP\php-cgi.exe exists. and there is a valid php.ini file in the same directory.

    Thanks,

    Don.

  • 11-19-2009, 4:22 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

     i think so the fastcgi files are located in system32\inetsrv  there are 5 of them  .ini, .dll, .rtf, .htm and .js

     

    the -c opened the php ini and it is located with the php-cgi.exe in the program files\php folder -v is verson and it is 5.2.11 which is what comes with wpi

     

    C:\Program Files\PHP>php-cgi.exe -c
    Error in argument 1, char 2: no argument for option c
    Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>]
           php <file> [args...]
      -a               Run interactively
      -b <address:port>|<port> Bind Path for external FASTCGI Server mo
      -C               Do not chdir to the script's directory
      -c <path>|<file> Look for php.ini file in this directory
      -n               No php.ini file will be used
      -d foo[=bar]     Define INI entry foo with value 'bar'
      -e               Generate extended information for debugger/profi
      -f <file>        Parse <file>.  Implies `-q'
      -h               This help
      -i               PHP information
      -l               Syntax check only (lint)
      -m               Show compiled in modules
      -q               Quiet-mode.  Suppress HTTP Header output.
      -s               Display colour syntax highlighted source.
      -v               Version number
      -w               Display source with stripped comments and whites
      -z <file>        Load Zend extension <file>.
      -T <count>       Measure execution time of script repeated <count

    C:\Program Files\PHP>php-cgi.exe -c c:\program files\php | php.ini

    C:\Program Files\PHP>php-cgi.exe -v
    PHP 5.2.11 (cgi-fcgi) (built: Sep 16 2009 19:32:01)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

    any other thoughts?

  • 11-19-2009, 4:29 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    don.raman:

    Open the fcgiext.ini file and see if things are proper. A properly set INI file should ideally have:

    [Types]
    php=PHP

    [PHP]
    ExePath=C:\Program Files\PHP\php-cgi.exe
    InstanceMaxRequests=10000
    ActivityTimeout=600
    RequestTimeout=600
    EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\Program Files\PHP\

    Did you check the INI file? Can you paste it here.

    Thanks,

    Don.

  • 11-19-2009, 4:34 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    I did check it and it looks the same



    [Types]
    php=PHP

    [PHP]
    ExePath=C:\Program Files\PHP\php-cgi.exe
    InstanceMaxRequests=10000
    ActivityTimeout=600
    RequestTimeout=600
    EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\Program Files\PHP\

  • 11-19-2009, 4:43 PM In reply to

    Re: PHP won't work after I followed the install and configure instructions

    Hi,

    This error means that some module which is required but not available. Can you look at the error log file. It should be at C:\Windows\Temp\php-errors.txt and see which module it is cribbing about.

    Thanks,

    Don.

Page 1 of 2 (28 items) 1 2 Next >
Microsoft Communities