[TriLUG] PHP for Mandrake 9.1

Tanner Lovelace lovelace at wayfarer.org
Thu Jan 8 23:13:56 EST 2004


Andrew DeFaria wrote:

> Hello. I hope you don't mine me emailing you directly (I've also cc'ed 
> trilug at trilug.org but I don't read that mail list regularly) but I seen 
> you post the following:
> 
>     BTW, I'm currently running apache2 and mod_php on Mandrake 9.1 and
>     didn't have any of the problems you're describing. What instructions
>     where you using? With Mandrake, everything should just work if you
>     install it using their rpms (using urpmi above).
> 
> I have Mandrake 9.1 running Apache 2.0 and have not been able to get php 
> working. I'd appreciate it if you could help me out.

Sure, I'll give it a shot.

> I was hoping that all the components for Apache2 and PHP were already 
> installed and all I needed to do was configure Apache correctly and it 
> would but that was not the case. There was only one library on my system 
> that had php in it at /usr/lib/libphp_common.so.430. Using that lib for 
> LoadModule and restarting Apache 2 complained of unresolved externals.

Mandrake 9.1 does include all the components for apache2 and php.
They are very well tested and work great together.  Mandrake actually
kept apache2 out of the main distribution for about a year and a half
while testing it.  I've run it myself for over a year with no problems.

> So I searched for RPMs for updating Apache2 and/or mod_php. I found 
> various packages but haven't been able to find the right packages to get 
> this to work.
> 
> For example, I found mod_php-4.3.1-1mdk and thought that that was all I 
> needed but I got:
> 
> $  rpm -i mod_php-4.3.1-1mdk.i586.rpm
> error: failed dependencies:
>         mm = 1.2.2 is needed by mod_php-4.3.1-1mdk
>         libmm.so.1   is needed by mod_php-4.3.1-1mdk
> 
> I can find libmm.so.1 but not the mm 1.2.2. I managed to get the source 
> for mm 1.2.2 and built and installed it. But I still fail with the above 
> dependency error since rpm's database we never updated to reflect that 
> mm 1.2.2 has been installed. So I told rpm to install without dependency 
> checks and configured Apache but when I visit a simply "helloworld.php" 
> page it asks me to save the file instead of echoing out "hello world".

Well, for one, on mandrake you shouldn't ever have to run rpm by itself.
Just like on Debian people say to not use dpkg directly, use apt-get
instead, on Mandrake you should always use urpmi.  It will take care of
all the dependencies for you.

> I also looked at the urpmi at http://plf.zarb.org/~nanardon but it tells 
> me to run:
> 
> $ urpmi.addmedia main 
> ftp://ftp.stealth.net/pub/mirrors/ftp.mandrake.com/Mandrake/9.1/i586/Mandrake/RPMS 
> with ../base/hdlist.cz
> 
> That doesn't look right! The relative path of ../base/hdlist.cz assumes 
> I'm supposed to be in some particular directory. Which directory am I 
> supposed to be in?

You're assuming that's a path on your local system.  It's not.  It's a
path on the repository side.  It *IS* correct.  If you follow the
instructions given on the Easy URPMI site, it's trivial to setup
urpmi.  Do what it says and have faith that it's correct.

> I tried:
> 
> $ cd /tmp
> $  urpmi.addmedia main 
> ftp://ftp.stealth.net/pub/mirrors/ftp.mandrake.com/Mandrake/9.1/i586/Mandrake/RPMS
>  with ./hdlist.cz
> added medium main
> examining synthesis file [/var/lib/urpmi/synthesis.hdlist.update_source.cz]
> examining synthesis file [/var/lib/urpmi/synthesis.hdlist.Local RPMs.cz]
> retrieving description file of "main"...
> retrieving source hdlist (or synthesis) of "main"...
> retrieving source hdlist (or synthesis) of "main"...
>     
> ftp://ftp.stealth.net/pub/mirrors/ftp.mandrake.com/Mandrake/9.1/i586/Mandrake/RPMS/hdlist.cz
> ...retrieving failed: curl failed: exited with 7 or signal 0
> 
> retrieve of source hdlist (or synthesis) failed
> no hdlist file found for medium "main"
> examining synthesis file [/var/lib/urpmi/synthesis.hdlist.main.cz]
> problem reading synthesis file of medium "main"
> unable to update medium "main"

Right, because, like I said, it's not a local path.  Just cut and paste
the instructions from the easy urpmi site
(http://plf.zarb.org/~nanardon/) to get urpmi setup.

Now, as to which rpm you should install.  This is what I have working on
my Mandrake 9.1 box:

% rpm -qa | grep apache
apache2-mod_suexec-2.0.44-2mdk
apache2-mod_dav-2.0.47-1.6.91mdk
apache2-mod_php-2.0.44_4.3.1-2mdk
apache2-modules-2.0.47-1.6.91mdk
apache-conf-2.0.44-11.1mdk
apache2-common-2.0.47-1.6.91mdk
apache-modules-1.3.27-8.1.91mdk
apache2-2.0.47-1.6.91mdk
apache2-mod_ssl-2.0.47-1.6.91mdk
apache2-manual-2.0.47-1.6.91mdk

Notice the rpm is "apache2-mod_php".  Just plain "mod_php" is
the one for apache 1.x.  Don't install that.  If you type this
command (after setting up urpmi), it should install apache2 and
mod_php together. (Note you should do this as root.  That's what
the # prompt stands for, so don't type that.)

# urpmi apache2-mod_php

That's it.  That will look up all the dependencies and install
them.  You can then do

# service httpd start

And apache will be started.  Configuration files are in
/etc/httpd.  If you still need help with configuration,
e-mail the list, please.

Cheers,
Tanner Lovelace



More information about the TriLUG mailing list