Unable to parse and process php files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Titus Cheung

    Unable to parse and process php files

    Hello,

    Just installed Apache and PHP. Edited the .conf file for the appropariate
    addtype lines, and Apache itself is working. However, when I type in the
    URL for the test script, the browser behaves as if it is going to download
    the file and ask if I want to open, or save it.

    Any ideas of why this is happening?

    Thanks


  • Erik Andersson

    #2
    Re: Unable to parse and process php files

    Have you restarted Apache to grant the changes to httpd.conf?

    Installing PHP for Apache as module
    ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~

    Now that version 4.1 introduces a safer sapi module, we recommend
    that you configure PHP as a module in Apache.

    To accomplish this, you have to load the php4apache.dll in your
    Apache httpd.conf.

    !! NOTE !!
    Whereever you load php4apache.dll from, php4apache.dll also
    needs the php4ts.dll also included in the PHP4 distribution.
    php4apache.dll depends on php4ts.dll which is loaded as soon as
    Apache loads php4apache.dll. If php4ts.dll can't be found, you
    usually get an error like (also see the "Problems?" section at
    the end of the file):

    Cannot load c:/php/sapi/php4apache.dll into server

    So where does php4ts.dll has to be to be properly loaded ?
    php4ts.dll is searched in the following order:

    1) in the directory where apache.exe is start from
    2) in the directory where php4apache.dll is loaded from
    3) in your %SYSTEMROOT%\Sy stem32, %SYSTEMROOT%\sy stem and
    %SYSTEMROOT% directory.
    Note: %SYSTEMROOT%\Sy stem32 only applies to Windows NT/2000/XP)
    4) in your whole %PATH%

    Note: What is %SYSTEMROOT% ? Depending on your Windows
    installation this may be for example c:\winnt or C:\windows

    Usually you would just copy it over to %SYSTEMROOT%\Sy stem32.
    But if you want to have multiple PHP installations (for
    whatever reason) this is a bad idea. For this circumstance the
    safest thing is to let php4ts.dll reside in the same directory
    where php4apache.dll is loaded from (see point 2 above).


    After you've set up the file layout properly, you're ready to
    finally configure Apache to load the PHP4 module. Just add the
    following lines to your httpd.conf:

    LoadModule php4_module c:/php/sapi/php4apache.dll
    AddModule mod_php4.c
    AddType application/x-httpd-php .php

    Note: Especially newer versions of Apache do not need the
    AddModule directive anymore, your milage may vary.


    Where do I have to put the php.ini ?
    The php.ini files is only searched in two places:
    1) in your Apache installation directory (e.g. c:\apache\apach e)
    2) in your %SYSTEMROOT% directory.

    --
    Erik Andersson ( E.N.E IT - Australia )
    ENEIT, ENE IT, Informática, soluciones integrales, redes, telefonía, barcelona

    - Australian, high quality web hosting from AU$4.95, all features included.

    "Titus Cheung" <titus@ieee.org > wrote in message
    news:QP9Bb.6087 22$6C4.249774@p d7tw1no...[color=blue]
    > Hello,
    >
    > Just installed Apache and PHP. Edited the .conf file for the appropariate
    > addtype lines, and Apache itself is working. However, when I type in the
    > URL for the test script, the browser behaves as if it is going to download
    > the file and ask if I want to open, or save it.
    >
    > Any ideas of why this is happening?
    >
    > Thanks
    >
    >[/color]


    Comment

    Working...