Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

PHP, Apache and MySQL

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

PHP, Apache and MySQL

Postby digitalgravy » Fri Jan 02, 2004 10:23 am

Hello,

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 :

/var/lib/mysql

+++++++++++++++++++++++++++++++++

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


Apache is functioning properly.


P.S.

I Couldnt fit this all in one post, so see below in the reply for the second half of this.
User avatar
digitalgravy
New php-forum User
New php-forum User
 
Posts: 32
Joined: Sat Feb 15, 2003 10:00 pm
Location: Los Angeles, CA

Postby digitalgravy » Fri Jan 02, 2004 10:27 am

+++++++++++++++++++++++++++++++++

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:
Code: Select all
./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 |
| http://www.php.net/manual/security.php 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

Code: Select all
./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 ...
User avatar
digitalgravy
New php-forum User
New php-forum User
 
Posts: 32
Joined: Sat Feb 15, 2003 10:00 pm
Location: Los Angeles, CA

Postby digitalgravy » Fri Jan 02, 2004 10:28 am

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
/var/lib/mysql/mysql
/usr/bin
/usr/lib/mysql
/usr/share/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.


Code: Select all
<?php phpinfo(); ?>


It shows under the mysql section the following:

Client API Version 3.23.49
MYSQL_MODULE_TYPE builtin
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
User avatar
digitalgravy
New php-forum User
New php-forum User
 
Posts: 32
Joined: Sat Feb 15, 2003 10:00 pm
Location: Los Angeles, CA

Postby sigix » Fri Jan 02, 2004 10:42 pm

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.
:cry:
sigix
php-forum Active User
php-forum Active User
 
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Postby digitalgravy » Mon Jan 05, 2004 9:35 am

These packages were not installed, by my choice. I want to install it myself and learn. Can anyone point me in the right direction?
User avatar
digitalgravy
New php-forum User
New php-forum User
 
Posts: 32
Joined: Sat Feb 15, 2003 10:00 pm
Location: Los Angeles, CA

Postby digitalgravy » Wed Jan 28, 2004 10:17 am

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!
User avatar
digitalgravy
New php-forum User
New php-forum User
 
Posts: 32
Joined: Sat Feb 15, 2003 10:00 pm
Location: Los Angeles, CA


Return to PHP Installation

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron