Hi,

I tried to reproduce that problem and didn't manage to do so. The problem you describe appears only if either the module couldn't be loaded or the AddType directive is not added to the httpd.conf.

Can you post your httpd.conf so we can look what might be wrong ?

    Unbelieveable,

    this is exactly what I did and it works for me perfectly. Which version of php and apache do you use (I installed apache 2.0.45 and php-4.3.1).

    Make sure that there is no older php4ts.dll in your system32 directory or something like this. Did you install apache as a service or do you start it in a console. Look for errors in the error_log of the apache server.

    Did you install the installer package of php or the one packaged as zip file ?

    Make sure that the engine is enabled in the php.ini (engine=on),
    but I doubt that this is the problem since the engine is enabled per default in the php.ini.

    Did you modify your php.ini

      I am using the save versions you just mentioned.

      It's possible that theres an older php.ini or php4ts.dll, but they would be of the same version.

      I haven't edited my php.ini file.

      I used the zip packaged because the installer doesn't come with everything.

        Hi,

        I read a post about a user that had similar problems. He was able to solve the problem by ... errr ... putting an empty line after the LoadModule line, e.g.

        LoadModule php4_module modules/php4apache2.dll

        AddType application/x-httpd-php .php .phtml .html
        AddType application/x-httpd-php-source .phps

        Don't know if that works, but you may try it.

          I have just noticed that you are not adding the php module in the apache modules!! Loading it is half of the job!!

          so use the following:

          LoadModule php4_module "\path\php4apache.dll"

          ClearModuleList
          AddModule mod_php4.c

          #AddModule mod_vhost_alias.c

            Hi,

            AFAIK AddModule doesn't exist anymore with apache 2.

            Did you try to setup apache so that it uses php as cgi ?

              I think on my last install, I did something with cgi. I'll try that again.

                Nope it still doesn't work. I added this.

                ScriptAlias /php/ "c:/php/"
                AddType application/x-httpd-php .php
                Action application/x-httpd-php "/php/php.exe"

                  Did you try to add the following lines to your httpd.conf ?

                  <Files "*.php">
                  SetOutputFilter PHP
                  SetInputFilter PHP
                  </Files>

                    After every change I made, i've been restarting it, but I guess it didn't really restart it. I just restarted my computer and now when I access http://localhost I get a not found error, so I need to look through the httpd.conf file again and fix some of the changes I made.

                      I deleted the scriptalias part then restarted my comp. php files are working now sorta. test.php(phpinfo()) works, but the php files that are for my site still display the code in the browser.

                      [edit]Is ther a way I can restart apache without restarting my comp? the usual way isn't working.

                        hey i'm a newby to php "servers" but have u made sure that u put the php4ts.dll in all the necessary folders?

                          Yup, I put it in apache2 folder. You can put it in either windows or apache root folder. All my pages except for two are working, the two are showing the php code in the browser. It might be a history thing so maybe only I am seeing it like that.

                            according to the php manual u need to put it in 4 directories

                              It works now. I looked at the page with netscape because netscape has no history of going there.

                              I keep the files in only one directory, apache root folder.

                              Thanks for all the help

                                btw u said u had a problem restarting the apache server, how do you normally try to restart it?

                                  I restart it from the start menu(start > program files > apache > restart). It worked that way with apache 1.3 but now I have 2.0.45 and it isn't as easy to restart. I remember reading that with a certain apache, that way doesn't really restart it.

                                    well there is another way

                                    if u have admin tools set on your computer i think its only for xp, but i dont know much about windows

                                    go into there and select services go to the apache service right click and click restart

                                    or if you cant access the services menu from there go to windows/system32/services.msc

                                    and do the same as above, i think that should work, thats how i start, stop & restart my services

                                      Write a Reply...