Hi. I'm using Apache which is included in the Linux Mandrake 7.1 distribution. Is there a way to install PHP to work with this version of Apache? The only way I know how to install apache+php+mysql is with the following procedures:

Uncompress the three packages.. *.tar.gz to desired directory

In Apache src directory (apache_1.3.12/)

./configure --prefix=/usr/local/apache

In PHP src directory (php-4.0b3/)

./configure --with-mysql \

--with-apache=../apache_1.3.12 \
--enable-track-vars

make

make install

In Apache src directory (apache_1.3.12)

./configure --prefix=/usr/local/apache \

--activate-module=src/modules/php4/libphp4.a

make

make install

Then, configure php.ini and httpd.conf (specifically the AddType application/x-httpd-php .php)

That's it. Everything will work properly from here. However, when I can't figure out how to install PHP to work with the default apache that comes with the mandrake package. Please help me.

    By the way, the procedure of installing Apache+PHP+MySQL was obtained from Web Blazonry.

      There is no way.

      PHP works as a module that needs to be compiled into the HTTPD binary.

        I found it easy to upgrade my Mandrake 7.1 system to PHP4. You don't need to compile modules directly into Apache, as it also supports dynamic modules.

        I followed instructions in the INSTALL file that comes with PHP4. Note that the INSTALL file covers more than one type of installation -- the one you're interested in is covered under the section "VERBOSE INSTALL" paragraph 2a (and continuing).

        What happens is that PHP compiles a shared library that is installed in Apache's private library directory. On a Mandrake installation that is /usr/lib/apache/. The PHP4 shared library is called libphp4.so.

        The PHP4 installation script modifies httpd.conf to tell Apache that it's necessary to load the shared library, and to define the proper file types (.php, .php3, .phps, .phtml) as associated with the PHP module.

        On my system I had to edit /etc/httpd/conf/httpd.conf manually to remove references to php3, which had been installed previously, and I also removed the library /usr/lib/apache/libphp3.so, since it was no longer needed.

        When you're done. run "apachectl restart" and you're off and running.

          Thanks for replying to my question. I tried what you suggested. However, error occurs because "apxs" is not installed in my system. I've tried installing it using rpmdrake but unfortunately, rpmdrake is asking for the installation cdrom2. I only have the cdrom1. I got my Mandrake 7.1 disc with the magazine I bought (Maximum Linux). It came free with the magazine. Do you know any other source where I can get the "apxs"? Thanks.

            It's in the apache-devel rpm, which is on the "extras" disk. You can grab the rpm from any of the Mandrake mirrors or from http://yelvington.com/stuff, where I just placed a copy.

              Thanks. Copied the apache-devel already from your site. I've installed everything and followed instructions but when I restarted apache, I can't view my site on "localhost". I know that there's nothing wrong with my hostnames coz "localhost:10000" (webmin) works properly.

              Here's what happens:

              When I run "apachectl restart", it says "apachectl restart: httpd restarted" but still I can't view my web page.

              When I run "httpd restart", it says "Loaded DSO modules/libphp4.so uses plain Apache 1.3 API, this module may crash under EAPI ! (please recompile it with -DEAPI)"

              I tried re-configuring php using "./configure --with-DEAPI --with-mysql... etc." but still I can't view my web page.

              Please help me. Thank you.

                Well, I'm stumped. If you have the Mandrake 7.1 Apache/Extranet server and the matching development RPM, the PHP4 stuff should slip right in there and apxs should handle the configuration for you. The only thing I can think of is that you need to be certain that you are starting from an absolutely clean slate (make clean before ./configure).

                  a month later

                  To configure with -DEAPI start your ./configure command as below (the # is the prompt, of course). I have been battling this for a while, and thing this may be the solution...

                  #env CFLAGS="-DEAPI" \
                  ./configure \
                  --with-apxs=

                    Write a Reply...