Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 28th October 2004, 12:37 AM
IceNine's Avatar
IceNine Offline
Registered User
 
Join Date: Oct 2004
Location: Carlsbad, CA
Age: 29
Posts: 93
How-to: Apache 2 - MySQL 4.1 - PHP 5.0.2 on Fedora Core 2

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.

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!

Last edited by IceNine; 28th October 2004 at 11:51 PM.
Reply With Quote
  #2  
Old 2nd November 2004, 03:40 AM
fragpot Offline
Registered User
 
Join Date: Oct 2004
Location: Dundee, Scotland
Age: 30
Posts: 6
Good work mate
Reply With Quote
  #3  
Old 2nd November 2004, 05:51 PM
IceNine's Avatar
IceNine Offline
Registered User
 
Join Date: Oct 2004
Location: Carlsbad, CA
Age: 29
Posts: 93
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.

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.

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.
__________________
Did I help? Add to my reputation! And please... DON'T ask why I'm a Slacker. ;)
Reply With Quote
  #4  
Old 9th November 2004, 06:42 AM
mustangfanatic Offline
Registered User
 
Join Date: Oct 2004
Posts: 73
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?
Reply With Quote
  #5  
Old 9th November 2004, 11:26 PM
IceNine's Avatar
IceNine Offline
Registered User
 
Join Date: Oct 2004
Location: Carlsbad, CA
Age: 29
Posts: 93
Have you tried rpm -e whatever-package?
__________________
Did I help? Add to my reputation! And please... DON'T ask why I'm a Slacker. ;)
Reply With Quote
  #6  
Old 11th November 2004, 03:08 PM
wprauchholz Offline
Registered User
 
Join Date: Nov 2004
Location: Barcelona - Spain
Age: 49
Posts: 308
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?
__________________
Salu2,

Wolfgang
Reply With Quote
  #7  
Old 11th November 2004, 03:25 PM
Pegasus Offline
Registered User
 
Join Date: Apr 2004
Posts: 208
Posted text removed by Pegasus

Last edited by Pegasus; 12th November 2004 at 03:05 AM.
Reply With Quote
  #8  
Old 11th November 2004, 06:01 PM
IceNine's Avatar
IceNine Offline
Registered User
 
Join Date: Oct 2004
Location: Carlsbad, CA
Age: 29
Posts: 93
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.
__________________
Did I help? Add to my reputation! And please... DON'T ask why I'm a Slacker. ;)

Last edited by IceNine; 11th November 2004 at 07:38 PM.
Reply With Quote
  #9  
Old 21st November 2004, 02:53 AM
HugoSthlm Offline
Registered User
 
Join Date: Nov 2004
Posts: 4
Smile Yess....

Quote:
Originally Posted by IceNine
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.

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
Reply With Quote
  #10  
Old 21st November 2004, 04:22 PM
egr Offline
Registered User
 
Join Date: Nov 2004
Location: Norway
Age: 27
Posts: 168
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?
Reply With Quote
  #11  
Old 1st December 2004, 12:02 AM
legbend Offline
Registered User
 
Join Date: Nov 2004
Posts: 15
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
Reply With Quote
  #12  
Old 2nd March 2005, 03:33 PM
bobotaito Offline
Registered User
 
Join Date: Nov 2004
Posts: 24
PHP5 + MySQL4 Installation procedure on FC3 (my experiences)

1. Remove old : php and mysql

Code:
$su -
Code:
$service httpd stop
Code:
$service mysqld stop
Code:
$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
Code:
$rpm -ivh mysql*.rpm perl*.rpm
4. Install PHP5:
Code:
$rpm -ivh --force db4*
(forcing installation of db4-*.rpm packages)

Code:
$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 :

Code:
$service httpd start
Code:
$service mysqld start
Worked for me!
Reply With Quote
  #13  
Old 2nd March 2005, 09:16 PM
mayo2000 Offline
Registered User
 
Join Date: Feb 2005
Posts: 10
Hi. I recommend this article>http://hulan.cz/blog/item/apache-2-0...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
Reply With Quote
Reply

Tags
mysql, php

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FC3 and mysql administrator and mysql query browser elmargaro Using Fedora 0 7th November 2005 06:01 PM
How to install mysql MySQL-server-4.0.26-0 FC2 or Upgrade 3.23.58-16.FC2.1 from to 4 niloshima EOL (End Of Life) Versions 1 28th October 2005 06:25 PM
MySQL: Can't open privilege tables: Incorrect information in file: './mysql/host.frm' benjamin.choi Servers & Networking 1 25th June 2005 04:19 PM
Install mail server from Postfix/CyrusSASL2/PAM-MySQL/MySQL/Dovecot/Amavisd/Clamav chengcsw Guides & Solutions (No Questions) 7 26th April 2005 08:38 PM


Current GMT-time: 11:00 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat