PHP, Apache and MySQL




I am having a small problem.

I bought the Sam's teach youself PHP, MySQL and Apache book, and I ran into a problem.

The book reccomends to install MySQL first, then Apache and then PHP.

I am running Red Hat 9.0 on a Athlon 1100 / 40 gig / 256 MB Ram

I have downloaded the following:
> MySQL RPM's for Server and Client 4.0.17-0
> Apache 2.0.48
> PHP 4.3.4

I installed MySQL via RPM's like the book, and the MySQL website reccommended. That worked fine. It installed it to :



I installed Apache from source and did the following
./configure --prefix=/usr/local/apache2 --enable-mods-shared=most --enable-module=so

Apache is functioning properly.


I Couldnt fit this all in one post, so see below in the reply for the second half of this.

I went to install PHP from source and here is the problem.

I followed along with the book ahd here is what it said to do:
./configure --prefix=/usr/local/php --with-mysql \ --with-apxs2=/usr/local/apache2/bin/apxs

This is the resulting error:
| *** WARNING *** |
| |
| You will be compiling the CGI version of PHP without any |
| redirection checking. By putting this cgi binary somewhere in |
| your web space, users may be able to circumvent existing .htaccess |
| security by loading files directly through the parser. See |
| for more details. |
Then when I issued the make command I got thos erroe:

make: *** [sapi/cgi/php] error 2

I deleted the uncomressed directory and started over again.

This time I removed the backslash after the --with-mysql

./configure --prefix=/usr/local/php --with-mysql --with-apxs2=/usr/local/apache2/bin/apxs

That removed the error about compiling php without re-direction checking. but it gave me a new error:
| *** WARNING *** |
| |
| You chose to compile PHP with the built-in MySQL support. If you |
| are compiling a server module, and intend to use other server |
| modules that also use MySQL (e.g, mod_auth_mysql, PHP 3.0, |
| mod_perl) you must NOT rely on PHP's built-in MySQL support, and |
| instead build it with your local MySQL support files, by adding |
| --with-mysql=/path/to/mysql to your configure line. |

Sorry, still wouldnt fit ...
The example in the book does not show any mysql error, it just shows the License and Note sections.

When I try to specify a path to MySQL I get this error:

configure: error: Cannot find MySQL header files under ...

I have tried:
/var/lib/mysql - This is where the rpms install MySQL

These are all locations I found when I used the search function on the desktop.

Even though it said it would use the built-in suppirt for MySQL I issued the make and make install commands and I coppied the php.ini file to where it should be.

I modified my httpd.conf and tested everything with a test script.

<?php phpinfo(); ?>

It shows under the mysql section the following:

Client API Version 3.23.49
MYSQL_SOCKET /var/lib/mysql/mysql.sock

Since I'm runnign MySQL 4.0.17-0 It should say that for the Client API Version right?

Is there somewhere else that I should specify for the path to mysql?

Thanks in Advance and sorry for the looooong question.

Happy New Year
did you check whether they are already installed, before installing all these packages ...
-for newbie you should have selected the php/mysql server packages during rh linux installation to avoid all this mess.
These packages were not installed, by my choice. I want to install it myself and learn. Can anyone point me in the right direction?
Well, I finally figured it out myself.

When you install MySQL via the rpm's you also have to install the devel rpm. Then you specify --with-mysql=/usr

It all works now!