[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need help installing PHP (Linux) with MySQL and Apache



-- Chip Rose <ncrose@pinn.net> wrote
(on Monday, 21 October 2002, 01:08 PM -0400):
> I can't get PHP-4.2.3 compiled to work with MySQL and Apache, despite months 
> of trying.  Apache compiled ok, and so did MySQL -both work, on my Debian 
> Linux box.
> 
> I've tried various combos of installing the Deb packages, compiling from 
> source, and various combinations thereto.  I started out using 
> http://hotwired.lycos.com/webmonkey/00/44/index4a_page4.html?tw=programming 
> as a guide, in efforts to create a way of accessing MySQL via PHP Gui of some 
> sort.  I've been trying for months, on and off, using Redhat, Mandrake, and 
> now Debian3.0.  
First off, if you're using Debian, why are you compiling Apache, MySQL,
and PHP? Are you trying to enable only certain modules? compile specific
options? If you're new to PHP and MySQL, install the Debian packages,
experiment, learn -- and THEN worry about optimizing the system.

In addition, if you want a web-based MySQL GUI, try phpMyAdmin... which,
fortunately, ALSO comes as a debian package. Apt-get is your friend,
especially when you're learning -- use it!

However, if you still feel the need to compile...

> I've tried getting Escapade installed, but pages won't load 
> unless I change a line in httpd.conf, and then Apache won't run because it 
> complains of the changed line in httpd.conf, which was supposedly necessary 
> to get Escapade to run.
Apache comes with a utility, apachectl, which has the option
'configtest' -- run it like:
    $ apachectl configtest
This will tell you if there's an error with your httpd.conf, and also
give a good indication of what it is. You should also *read* your
httpd.conf, as well as the documentation (in debian package apache-doc,
usually included with source) on the various options and directives for
httpd.conf

> Typing ./httpd -l in my Apache bin directory shows that "mod_so.c" is an 
> enabled module.  My attempt to compile PHP-4.2.3 by typing 
> ./configure --with-mysql=/usr/bin/  resulted in the following error message
> configure: error: Cannot find header files under /usr/bin/
> 
> I've tried changing the path to MySQL headers, but still get same error msg.  
> I really don't know how to find these MySQL headers since I wouldn't know one 
> if I saw it.
What prefix did you use when you compiled MySQL? If you installed via
debian, you need to make sure you have the mysql-dev package installed,
and I believe you would then specify --with-mysql=/usr. If you compiled
it, if you didn't specify a --prefix= option to ./configure when
compiling, it usually defaults to /usr/local.  If this was the case, you
need to specify --with-mysql=/usr/local (no /bin, no /lib -- just the
prefix for the install directory). Also, as far as enabling the PHP
module, you will need to tell apache to load it -- look for the section
with lines starting with "LoadModule", and you'll need to pass the path
to libphp4.so -- see the install instructions for PHP.

Just to reiterate -- if you're completely new to Apache, MySQL, and PHP,
and you're trying to learn, don't start with compilation. Use apt and
grab the apache, php, and mysql packages that you need and start from
there. When you've got enough knowledge that you know *why* you need to
compile (certain optimizations, require the latest source [though this
is somewhat moot if you use debian's unstable tree], or a specific patch
for added functionality), then compile. And when you DO decide to
compile, read the installation and README files in the source
thoroughly!

(This all comes from somebody who learned the hard way, when there was
no reason to!)

-- 
Matthew Weier O'Phinney
matthew@weierophinney.net



Reply to: