problem run php scripts on localhost using iis

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hdf
    New Member
    • Jan 2007
    • 24

    problem run php scripts on localhost using iis

    hi
    i have a problem with my iis it doesnt want to open up my php file and it did work in the pas but now al of a suden it doesnt want to open.I didnt make any changet or nothing

    Can you hlp
  • radcaesar
    Recognized Expert Contributor
    • Sep 2006
    • 759

    #2
    With out making any changes (With out ur knowledge), hows it possoble. Chack with PHP.ini file and iis extensions.

    Else its simple, Reinstall PHP parser.

    :)

    Comment

    • hdf
      New Member
      • Jan 2007
      • 24

      #3
      Originally posted by radcaesar
      With out making any changes (With out ur knowledge), hows it possoble. Chack with PHP.ini file and iis extensions.

      Else its simple, Reinstall PHP parser.

      :)
      hi

      i did a reinstall of php and still does the same thing

      Comment

      • radcaesar
        Recognized Expert Contributor
        • Sep 2006
        • 759

        #4
        What version of PHP you are using and what is IIS Version ?

        U manually installed PHP or used install shield ??

        Did u seen a file structure like this in ur system ? (PHP Installed folder)

        c:\php
        |
        +--dev
        | |
        | |-php5ts.lib
        |
        +--ext -- extension DLLs for PHP
        | |
        | |-php_bz2.dll
        | |
        | |-php_cpdf.dll
        | |
        | |-..
        |
        +--extras
        | |
        | +--mibs -- support files for SNMP
        | |
        | +--openssl -- support files for Openssl
        | |
        | +--pdf-related -- support files for PDF
        | |
        | |-mime.magic
        |
        +--pear -- initial copy of PEAR
        |
        |
        |-go-pear.bat -- PEAR setup script
        |
        |-fdftk.dll
        |
        |-..
        |
        |-php-cgi.exe -- CGI executable
        |
        |-php-win.exe -- executes scripts without an opened command prompt
        |
        |-php.exe -- CLI executable - ONLY for command line scripting
        |
        |-..
        |
        |-php.ini-dist -- default php.ini settings
        |
        |-php.ini-recommended -- recommended php.ini settings
        |
        |-php5activescrip t.dll
        |
        |-php5apache.dll
        |
        |-php5apache2.dll
        |
        |-..
        |
        |-php5ts.dll -- core PHP DLL
        |
        |-...

        Comment

        • radcaesar
          Recognized Expert Contributor
          • Sep 2006
          • 759

          #5
          If its Manual installation on IIS 5.1

          Then theck these steps.

          The first step is to extract all of the files from the downloaded zip file into C:PHP (create the folder if it doesn’t already exist).
          You may choose a different location, although it is not recommended. The path must NOT have spaces, for example, you cannot use C:Program FilesPHP. Some web servers may not be able to handle the path name and will fault. PHP 5 includes a CGI executable, a CLI executable as well as the server modules. The DLLs needed for these executables can be found in the root of the PHP folder (C:PHP). php5ts.dll needs to be available to the web server. To do this, you have 3 options:

          1. Copy php5ts.dll to the web server’s directory (C:inetpubwwwro ot).

          2. Copy php5ts.dll to the Windows system directory (C:windowssyste m32).

          3. Add the PHP directory path to the environment variables PATH.

          We will go with option 3, because we would like to keep all of our PHP install files in the same location, for easier cleanup later, if needed. Let’s proceed…

          Instructions on how to put C:php in env variables PATH.

          First we want to open System Properties. There are two ways to get to System Properties. Either way will work.

          1. Right-Click on My computer and choose “properties”.

          2. Go to Control Panel, and select “System”.

          Once here, we want to select the Advanced tab. In the Advanced tab, click the “Environment Variables” button. There are two sections in the Environment Variables window, User Variable and System Variables. We will be using System Variables. Scroll down in System Variables until you find the variable PATH. Highlight that line and the select Edit below the System Variables window. We will only be adding to the Variable Value. BE CAREFUL HERE. You do not want to delete anything on this line. Simply find the end of the line and add a semi-colon ( ; ) if there is not one already. After the semi-colon, type: C:PHP and then hit OK. Now click OK on the Environment Variables window. Finally click OK on the System Properties window and we are done with this part.

          Now we must restart the computer to make the Environment Variables changes come into play. We cannot simply log off and log on, you must restart.

          The next step is to set up a config file for PHP, php.ini. In C:PHP you will find two files named php.ini-dist and php.ini-recommended. We will use php.ini-recommended for this install, and all you need to do is rename it from php.ini-recommended to php.ini.

          1. doc_root = C:inetpubwwwroo t

          2. cgi.force_redir ect = 0

          Now PHP is installed, lets move on to preparing our IIS to use PHP.

          Configure IIS to use PHP.

          1. Open IIS

          2. Under Home Directory: Set “Execute Permissions” to “Scripts Only”

          3. Click on configuration..

          a. Click Add

          b. Set “executable” to C:PHPphp5isapi. dll

          c. Set “extension” to .php (don’t forget to include the . )

          d. Click OK

          e. Click Apply, then OK.

          Under ISAPI Filters

          a. Click “Add”

          b. Set Filter Name to PHP

          c. Set Executable to C:PHPphp5isapi. dll

          d. Click OK.

          e. Click Apply, then OK.

          Restart the Web Server
          Now we want to test PHP on our system. To do this, we will create a file called phpinfo.php and it will be used to display all of the PHP info from our system in our web browser.

          1. Open Notepad and type:

          2. Save the file as phpinfo.php and select the file type ‘All Files’ (Important: do not save the file as .txt, as it will not work).

          3. Move the file into C:inetpubwwwroo t

          4. Open your web browser and type: http://localhost/phpnfo.php

          5. Your browser should display a lot of PHP information.

          Comment

          • hdf
            New Member
            • Jan 2007
            • 24

            #6
            hi
            thanx its showing the php info, but i have a problem connectiong to my Mysql database ( im using SQLyog v 4 for database).
            and it guves me the following error:
            Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwr oot\multisure.c o.za\www\test.p hp on line 10

            Comment

            • radcaesar
              Recognized Expert Contributor
              • Sep 2006
              • 759

              #7
              To fix this, find the line:

              ;extension=php_ mysql.dll inyour php.ini file and remove the leading semicolon to uncomment it like so:

              extension=php_m ysql.dll

              You might also want to uncomment the extension to php_gd2.dll (for graphics purposes).

              Next, ensure that the files php_mysql.dll and libmysql.dll can be reached by php by modifying and uncommenting the line:

              extension_dir = "C:\php\ext \"

              to something more appropriate to your system. Verify this by looking at the value returned by:

              < ?php phpinfo() ? >

              :)

              Comment

              • hdf
                New Member
                • Jan 2007
                • 24

                #8
                i have done the changet to the php.ini file but it still have the same effect

                Comment

                • hdf
                  New Member
                  • Jan 2007
                  • 24

                  #9
                  hi the page is displaying but i getting the following code:
                  MemberId,1, $db)); echo (" ".deactdate($ob jSalesPsn->

                  Comment

                  • radcaesar
                    Recognized Expert Contributor
                    • Sep 2006
                    • 759

                    #10
                    This will be caused when you use some invalid PHP keywords which are unable to identified by the parser.

                    Check that particular line in ur PHP file.
                    :)

                    Comment

                    • hdf
                      New Member
                      • Jan 2007
                      • 24

                      #11
                      hi

                      well its shows the php code on all the pages that contains php code. is look like it is unble to read the php code .Must i chech the php.ini file

                      Comment

                      • Atli
                        Recognized Expert Expert
                        • Nov 2006
                        • 5062

                        #12
                        Try setting short_open_tag to On in your php.ini

                        Comment

                        • akuAmy
                          New Member
                          • Jan 2007
                          • 1

                          #13
                          i'm quiet blur to open IIS. where i must go to open the IIS... before this, i'm trying open IIS in Services and under Administratives tools.. but i can't still found the features that you explained.. like below :

                          2. Under Home Directory : Set "Execute Permissions" to "Script Only"

                          and the rest...

                          ... please help me

                          Comment

                          • softDeveloper
                            New Member
                            • Feb 2007
                            • 2

                            #14
                            That simply Perfectly worked for me.You r gr8.Thankx Dear

                            Comment

                            • softDeveloper
                              New Member
                              • Feb 2007
                              • 2

                              #15
                              Originally posted by radcaesar
                              If its Manual installation on IIS 5.1

                              Then theck these steps.

                              The first step is to extract all of the files from the downloaded zip file into C:PHP (create the folder if it doesn’t already exist).
                              You may choose a different location, although it is not recommended. The path must NOT have spaces, for example, you cannot use C:Program FilesPHP. Some web servers may not be able to handle the path name and will fault. PHP 5 includes a CGI executable, a CLI executable as well as the server modules. The DLLs needed for these executables can be found in the root of the PHP folder (C:PHP). php5ts.dll needs to be available to the web server. To do this, you have 3 options:

                              1. Copy php5ts.dll to the web server’s directory (C:inetpubwwwro ot).

                              2. Copy php5ts.dll to the Windows system directory (C:windowssyste m32).

                              3. Add the PHP directory path to the environment variables PATH.

                              We will go with option 3, because we would like to keep all of our PHP install files in the same location, for easier cleanup later, if needed. Let’s proceed…

                              Instructions on how to put C:php in env variables PATH.

                              First we want to open System Properties. There are two ways to get to System Properties. Either way will work.

                              1. Right-Click on My computer and choose “properties”.

                              2. Go to Control Panel, and select “System”.

                              Once here, we want to select the Advanced tab. In the Advanced tab, click the “Environment Variables” button. There are two sections in the Environment Variables window, User Variable and System Variables. We will be using System Variables. Scroll down in System Variables until you find the variable PATH. Highlight that line and the select Edit below the System Variables window. We will only be adding to the Variable Value. BE CAREFUL HERE. You do not want to delete anything on this line. Simply find the end of the line and add a semi-colon ( ; ) if there is not one already. After the semi-colon, type: C:PHP and then hit OK. Now click OK on the Environment Variables window. Finally click OK on the System Properties window and we are done with this part.

                              Now we must restart the computer to make the Environment Variables changes come into play. We cannot simply log off and log on, you must restart.

                              The next step is to set up a config file for PHP, php.ini. In C:PHP you will find two files named php.ini-dist and php.ini-recommended. We will use php.ini-recommended for this install, and all you need to do is rename it from php.ini-recommended to php.ini.

                              1. doc_root = C:inetpubwwwroo t

                              2. cgi.force_redir ect = 0

                              Now PHP is installed, lets move on to preparing our IIS to use PHP.

                              Configure IIS to use PHP.

                              1. Open IIS

                              2. Under Home Directory: Set “Execute Permissions” to “Scripts Only”

                              3. Click on configuration..

                              a. Click Add

                              b. Set “executable” to C:PHPphp5isapi. dll

                              c. Set “extension” to .php (don’t forget to include the . )

                              d. Click OK

                              e. Click Apply, then OK.

                              Under ISAPI Filters

                              a. Click “Add”

                              b. Set Filter Name to PHP

                              c. Set Executable to C:PHPphp5isapi. dll

                              d. Click OK.

                              e. Click Apply, then OK.

                              Restart the Web Server
                              Now we want to test PHP on our system. To do this, we will create a file called phpinfo.php and it will be used to display all of the PHP info from our system in our web browser.

                              1. Open Notepad and type:

                              2. Save the file as phpinfo.php and select the file type ‘All Files’ (Important: do not save the file as .txt, as it will not work).

                              3. Move the file into C:inetpubwwwroo t

                              4. Open your web browser and type: http://localhost/phpnfo.php

                              5. Your browser should display a lot of PHP information.
                              thats the perfect answer for me.Thankx.U r gr8

                              Comment

                              Working...