ok...i'm about to throw the pc out the window. PHP wont install correctly. Here is the scenario...

Installed MYSQL correctly...I have a /usr/local/mysql directory....so I ran thhis command

./configure --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs

so this compiled correctly, make and make install went well....

then I re-compiled apache...and here is the problem..I placed

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

apache starts without complaints, but when I browse a php file

<? phpinfo() ?>

it tries to download it instead of executing..can someone help!!

thanks!!

devlogos

    I found I had a similar problem.
    It was an unknown server problem.
    In you httpd.conf file, see what ServerName is. I originally had it as 127.0.0.1 but it didnt work, but after naming it to the correct server name (www.something.com) and adding the new www address to my /etc/host file, it went OK and ran properly

    Hope this helps

    Uriel

      Thanks, but my servername is set up correctly because I am able to see the web page. Only .php files are not executed, and the browser tries to download them. Any more ideas?

      devlogos

        in the httpd.conf under the Types tag file have you added??

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

        Try this

          this is what I have...

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

          which is essentially the same..however, do you have these directives:

          #LoadModule php4_module libexec/libphp4.so

          or something the sort? I believe I tried that..

            I do not have the Loadmodule in my http.conf file, but I do have it compiled in.I used ./configure --activate-module=src/modules/php4/libphp4.a and the --enable-module=php4 during the compilation process for apache.

            If i list my installed modules php4 comes up (search the apache site for the correct command to check the currently installed modules). Try listing the modules and see if php4 is even compiled in.

            Good luck and if I think of something else I'll drop another line

            Uriel

              I'm a little bit confused..which configure ./configure did your use for apache and for php?

              I dont think php is compiled in my apache...but I read on a site that it was unnecessary...maybe it is..

              can you please tell me what configure commands you used and the order you used them? perohaps that makes a difference too...thanks

                I have had the same (download) problem with Apache/PHP on Redhat 7.2.

                I know I have php set as a cgi with the ./configure command. What i can't do is get php to process a page. (Which means I'm not getting the cgi called as the correct helper application for the .php .phtml extension.)

                Have you use the scriptAlials command in your apache configuation file?

                srh

                Please let me know if you come up with an answer.

                  Hi;

                  Yuo should check that you have the AddTypes for php4 in your httpd.conf file
                  If not add them in.
                  They are listed by devlogos in his original posting.

                  If you do have them, you should recompile php with apache support and then recompile apache afterwards for php.
                  Something as follows:
                  PHP:
                  ./configure --with-apache=/usr/tmp/apache (or whatever the path is to the apache SOURCE code ) --with-xml --with-mysql=/usr/tmp/mysql (as above this is the path to the source code for mysql)
                  then:
                  make
                  then make install.

                  Now go to the apache source code directory and type
                  ./configure --activate-module=src/modules/php4/libphp4.a --enable-module=php4
                  then hit enter and thereafter make and make install.
                  THEN REBOOT the machine
                  and now see if the httpd.conf has the AddType referred to above and add them if it doesnt.
                  You should then start apache and in the URL:
                  type http://localhost/test.php
                  (where test.php is the file that has phpinfo() in it.

                  Hope this helps

                  Good Luck
                  Uriel

                    Write a Reply...