PDA

View Full Version : MySQL 4.1 - PHP 5.0.2


IceNine
28th October 2004, 12:37 AM
Here is how to install PHP5 and MySQL 4.1 on FC2, assuming you have Apache 2.0.49 (comes with FC2).

Preparing Apache

I had trouble with apxs, but swiftly realized I needed httpd-devel:

yum install httpd-devel

Upgrading MySQL

After that we upgrade MySQL. Unfortunately, MySQL 3.23 is installed and is a pain to upgrade. I decided to use 'apt-get' after viewing this page (http://code.oncloud8.com/archives/2004/09/upgrading_fedor.html).

apt-get remove mysql-3.23.58-4
apt-get remove mysql-server-3.23.58-4
apt-get remove php-mysql-4.3.8-1.1
apt-get remove mod_auth_mysql-20030510-3
apt-get remove perl-DBD-MySQL-2.9002-1

After that, download all necessary MySQL rpms into a directory (/usr/local/src/RPMS/ for me) and install them:

rpm -ivh MySQL*rpm

Follow the MySQL after installation instructions on their website.

Installing PHP

Now that we have httpd-devel, we have /usr/sbin/apxs - This is required to build the libphp5.so module. Download the latest PHP (5.0.2) .tgz into a dir (/usr/local/src) for me.

tar -zxvf php*
cd php*

Here is my configure configuration:

./configure --host=i386-redhat-linux --build=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --enable-ftp --enable-sockets --with-mysql=shared,/usr --with-apxs2=/usr/sbin/apxs --with-mysqli=/usr/bin/mysql_config

make && make install

Then make sure your Apache configuration is good (like in the PHP or Apache docs).

Have fun!

fragpot
2nd November 2004, 03:40 AM
Good work mate

IceNine
2nd November 2004, 05:51 PM

Just as a slight follow-up, you might be asking yourself, "Why MySQL 4.1 and not 3.23 or even 4.0?" To you, I have a few things to say.

First off, you should be running the latest stable production anything, as long as it doesn't mess up your application. There is very little backwards incompatibility between these versions. 3.23 is old. So old that they don't even offer the download on their site anymore. Most of the documentation reflects features in the 4+ versions.

Second, MySQL 4 and up offers a little thing called Query Cache. What is that? The Query Cache essentially saves queries in memory, saving processing time. For example, let's say you host a BBS that runs a query to select all open forums. Every time it runs the same query and retrieves the same results. With the Query Cache, it will have stored the results and will spit them out without running the query on the databse. But what if my data changes? Your MySQL database server will know that and remove the cached query.

Third, as of 4.1, MySQL offers Subqueries. This is a huge part of other, more powerfull (and more expensive) databases, like Oracle. Subqueries? This is a huge topic, so I'll kindly refer you to this page. (http://dev.mysql.com/doc/mysql/en/Subqueries.html)

Fourth, again as of 4.1, Temporal Functionality. And again, I'm not going to reinvent the wheel on writing this rather large topic up, so I'll refer you to this page. (http://dev.mysql.com/tech-resources/articles/4.1/time.html)

There is a lot to be said about great PHP code, but if your database design isn't up to par, your site will suffer. My advice to any PHP programmer: Learn how and why your database works the way it does.! This is absolutely crucial to efficiency.

Good luck! And if you have any questions, feel free to contact me.

mustangfanatic
9th November 2004, 06:42 AM
apt-get remove doesn't not work. It just says it cannot find the packages

[root@sw0nage eric]# rpm -qa | grep mysql
mysql-jdbc-3.0.8-2
mysql-jdbc-tomcat-3.0.8-2
mysql-devel-3.23.58-9
mysql-bench-3.23.58-9
mysql-3.23.58-9
mysql-server-3.23.58-9
[root@sw0nage eric]# apt-get remove mysql-jdbc-3.0.8-2
Reading Package Lists... Done
Building Dependency Tree... Done
E: Couldn't find package mysql-jdbc-3.0.8-2

Oddly enough apt-get install synaptic doesn't work either. Is my apt-get messed up?

IceNine
9th November 2004, 11:26 PM
Have you tried rpm -e whatever-package?

wprauchholz
11th November 2004, 03:08 PM
Hello IceNine. You would'nt believe, but I still have not given up!! I still cannot connect to the mysql database. No I am trying to compile php. I prepared the file configure and started with ./configure. How long is this process taking?

Pegasus
11th November 2004, 03:25 PM
Posted text removed by Pegasus

IceNine
11th November 2004, 06:01 PM
Thanks for the useless comment...

EDIT
Sorry, that was a little crass. The main reason I would not go with something prepackaged is for security, but it also has a lot of extra configure options that I don't need. And probably some I do. This is my install process for a production server for my company.

HugoSthlm
21st November 2004, 02:53 AM
Here is how to install PHP5 and MySQL 4.1 on FC2, assuming you have Apache 2.0.49 (comes with FC2).

Preparing Apache

I had trouble with apxs, but swiftly realized I needed httpd-devel:

yum install httpd-devel

Upgrading MySQL

After that we upgrade MySQL. Unfortunately, MySQL 3.23 is installed and is a pain to upgrade. I decided to use 'apt-get' after viewing this page (http://code.oncloud8.com/archives/2004/09/upgrading_fedor.html).

apt-get remove mysql-3.23.58-4
apt-get remove mysql-server-3.23.58-4
apt-get remove php-mysql-4.3.8-1.1
apt-get remove mod_auth_mysql-20030510-3
apt-get remove perl-DBD-MySQL-2.9002-1

After that, download all necessary MySQL rpms into a directory (/usr/local/src/RPMS/ for me) and install them:

rpm -ivh MySQL*rpm

Follow the MySQL after installation instructions on their website.

Installing PHP

Now that we have httpd-devel, we have /usr/sbin/apxs - This is required to build the libphp5.so module. Download the latest PHP (5.0.2) .tgz into a dir (/usr/local/src) for me.

tar -zxvf php*
cd php*

Here is my configure configuration:

./configure --host=i386-redhat-linux --build=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --enable-ftp --enable-sockets --with-mysql=shared,/usr --with-apxs2=/usr/sbin/apxs --with-mysqli=/usr/bin/mysql_config

make && make install

Then make sure your Apache configuration is good (like in the PHP or Apache docs).

Have fun!
Hi all !

I tried this and it still didn't work. Still had the empty libxml.lo.

Then I got a tip somewhere that it could be a missing dependency. So I moved the make of libxml to the top of Makefile-objects, and poff ! PHP 5.0.2 was installed with MySQL 4.1 and Apache 2.0.51.

More fun now..

Hugo

egr
21st November 2004, 04:22 PM
Hmm, I did everything, but insted of *.php page I see php source, php doen't work,
I have LoadModule in httpd.conf and I did ./httpd restart
What's the problem?

legbend
1st December 2004, 12:02 AM
its easier to use:

yum remove mysql. then run the MySQL RPMs.

then go to http://download.fedora.redhat.com/pub/fedora/linux/core/development/(your version)/Fedora/RPMS

download the php5 RPMs, especially including the php-mysql rpm.

you will also need to download db4-4 rpm.

first run: rpm -ivh db4-4*rpm
then run: rpm -ivh php*rpm

restart apache

bobotaito
2nd March 2005, 03:33 PM
PHP5 + MySQL4 Installation procedure on FC3 (my experiences)

1. Remove old : php and mysql

$su -$service httpd stop$service mysqld stop$yum remove mysql php

and wait...

2. Download development packages from redhat server (or mirrors)
+ For mysql : all mysql-*.rpm, perl-DBD-MySQL (to resolve dependency)
+ For php : all php*.rpm, db4*.rpm

3. Install MySQL :
Go to directory where you've downloaded rmps packages and type
$rpm -ivh mysql*.rpm perl*.rpm

4. Install PHP5:
$rpm -ivh --force db4* (forcing installation of db4-*.rpm packages)

$rpm -ivh php*.rpm

(For the package php-snmp, there is a dependency problem that I could not resolve, so I didn't install it)

Voila, they are installed.

5. Restart services :

$service httpd start
$service mysqld start

Worked for me!

mayo2000
2nd March 2005, 09:16 PM
Hi. I recommend this article>http://hulan.cz/blog/item/apache-2-0-52-ssl-php-5-0-3-mysql-4-1-9-on-linux
I don't need to download all libraries if you're using FC3.
You have to download missing: libiconv library, cpdflib library

You can also have problem with configure parameters of php 5.0.3, which can cause this error:

Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/libphp5.so
chmod: cannot access `/usr/local/apache2/modules/libphp5.so': není souborem ani adresářem
apxs:Error: Command failed with rc=65536

The solution is easy. Correct paths, in your php configure parameters


Sorry, my english is very poor