LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-19-2007, 12:49 PM   #1
EnderX
Member
 
Registered: Nov 2006
Posts: 66

Rep: Reputation: 15
What is the proper way to add modules to an installation of php5?


If I have placed this question in the wrong area of the forum, I apologize, and respectfully request that it be moved to where it belongs. This simply seemed to be the most logical place for the thread to go.

I am currently attempting to work with a server running the SuSE 9.3 OS, apache2, php 5.2.0, and MySQL. (Sorry, I can't recall offhand what version of MySQL the system is running.) In previous versions of PHP, internal libraries were provided for accessing MySQL databases. As of php5, that has ceased. I have a copy of php4 on the same system, so I know that I have the libraries I need, but I am not sure where they are, nor how to properly add them to the configuration command for php5. I'm wanting to think that the proper procedure would simply be add the --with-mysql command, adding the path to the appropriate .so file, but I'm not certain about that. Is this the correct way to add a module to a configuration setup? And if not, would someone please be gracious enough to point me towards some documentation that does describe the correct manner to do this?

Thank you for your consideration.
 
Old 02-19-2007, 01:50 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
To compile php with mysql support and of course build it as a module for apache, you need at least:
Code:
./configue --with-mysql=/path/to/mysql --with-apxs2=/path/to/apache/bin/apxs
Note that /path/to/mysql is the directory where mysql is installed and you can omit it if you want to build the default mysql support. You can also use the new mysqli extension "./configue --with-mysqli=/path/to/mysql_config" for newer versions of mysql. Just check to see if you have the mysql_config file.
Running ./configure --help will give you all the available options
 
Old 02-19-2007, 03:18 PM   #3
EnderX
Member
 
Registered: Nov 2006
Posts: 66

Original Poster
Rep: Reputation: 15
A check reveals that I do not have mysql_config anywhere on the system I'm working on.

What files should I be looking for? I was under the impression I was supposed to be looking for a file 'mysql.so', but when I tried that I got the following error:
Code:
configure: error: Cannot find MySQL header files under /usr/lib/php/extensions/mysql.so.
Since it says it can't find the header files, do you have any suggestions as to what I might need to start looking for? I'm not sure exactly what the installation wants at this point.

Thank you for your consideration.
 
Old 02-20-2007, 02:37 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You can leave just --with-mysql, so php uses its built-in mysql extension, or you can point to the directory where your mysql is installed (--with-mysql=/path/to/mysql), so php uses your specific mysql version. According to this mysql header files are installed in /usr/include/mysql
 
Old 02-20-2007, 10:12 AM   #5
EnderX
Member
 
Registered: Nov 2006
Posts: 66

Original Poster
Rep: Reputation: 15
Thank you for your assistance. However, I'm still a bit stumped.

PHP5 no longer comes with the built in extensions; an attempt to run ./configure with just the '--with-mysql' tag leads to the following error message:
Quote:
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!
Also, I was not the one who set up MySQL on this system, my predecessor did. I do not know what path he installed it on, and attempts to seek it out using the find command reveal far too many possible options. (21 files or directories with paths ending in /mysql, 3 with paths ending in /mysql.so. I tried them all anyway, and got the same kind of error, with the word 'yes' replaced with the path in question.) Is there some way to determine the path of a set of libraries without having to know the name of one or more of the files within? I might be able to seek them out from MySQL somehow if that's possible. Is it? Or is there something similar I could do to track down the file path?

Again, thank you for your assistance.
 
Old 02-21-2007, 01:59 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
If you still have your old php and it was compiled against the same mysql you're trying to use, run:
Code:
 php -i|grep with-mysql
to find the correct path to mysql.
Another way it to find where the file mysql.h is and use that directory.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache2 php4 and php5 as modules Nathanael Linux - Software 1 08-09-2005 11:10 AM
Proper way to add in hardware not auto detected Bluesuperman Red Hat 4 04-30-2005 10:35 PM
Proper way to add modules gameport.o and cmpci.o rundarm Linux - Newbie 2 07-16-2004 10:32 PM
What to add to etc/file/host for proper boot? Cliff Fussell Linux - Newbie 3 01-21-2004 09:22 PM
Proper location for created modules? vrillusions Mandriva 1 09-09-2003 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration