LinuxQuestions.org
Review your favorite Linux distribution.
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 09-09-2007, 08:31 AM   #16
Pronco
LQ Newbie
 
Registered: Aug 2004
Location: Somewhere Near
Distribution: Slackware-Current, Debian 3.1rc, Gentoo 2005, Mandriva 2006, Ubuntu Fiesty 2007
Posts: 15

Rep: Reputation: 0

PHP Code:
yum install mysql-devel 
It does fix the problem

Thank you!
 
Old 10-17-2007, 04:04 PM   #17
jeraarts
LQ Newbie
 
Registered: Oct 2007
Posts: 1

Rep: Reputation: 0
Solution for Debian Etch: instal the libmysqlclient<NN>-dev package.

I am a new to Linux, but I learned to always install the dev(el) packages (through apt-get or Synaptic) when missing stuff when compiling

Cheers and happy Linuxing

- Jeroen

Last edited by jeraarts; 10-17-2007 at 04:08 PM.
 
Old 02-27-2008, 09:27 PM   #18
psuresh
LQ Newbie
 
Registered: Apr 2006
Location: Chennai
Posts: 10

Rep: Reputation: 0
Thumbs up Its work

Quote:
Originally Posted by bathory View Post
Where is your mysql installed? You must point the --with-mysql= to that directory.
Hi Thank you i installed php --with-mysql=/usr/local/mysql. My error got fixed. Thank you so much for your help.
 
Old 03-07-2008, 03:54 AM   #19
vbisht
LQ Newbie
 
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0
did you install mysql headers

if installing php with mysql support ..make sure that you have installed mysql headers and libraries.. all this can be done by installting corrsponding rpm. See Headers and libraries section under mysql distro
 
Old 11-14-2008, 12:03 PM   #20
kkm
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
I'm not that much sure about whether it will work with RPM installations. I've done mysql installation through compilation of source files, where I used "--prefix=/usr/local/mysql"

I started mysql daemon and a socket file will be created and that is /var/lib/mysql/mysql.sock

so I gave the configure command for php like this: -

# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ -with-mysql-sock=/var/lib/mysql/mysql.sock


and it worked!!
 
Old 07-04-2010, 10:17 AM   #21
grob115
Member
 
Registered: Oct 2005
Posts: 541

Rep: Reputation: 32
Wheew. The instructions on php.net just plain sucks. As described on this thread, the MySQL devel package needs to be installed (can download this from MySQL's site). I also found that I have to do "yum install libxml2-devel" as well. In addition to these, the "--with-libdir=lib64" does need to be specified, or you'll get the error "configure: error: Cannot find MySQL header files under /usr".

The whole command I used is:
Code:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/src --with-libdir=lib64
And yeah, my CentOS 5.5 came with "MySQL client programs and shared libraries" but I removed it via yum using the --nodeps option (or it'd complain about how it also need to remove Dovecot). Then downloaded the client, shared libraries, and devel RPM packages from MySQL's site. It's the devel RPM that saves the day but installed the other two just in case.

However, another problem came up. Following instructions here and adding the following lines to the httpd.conf caused a problem.
LoadModule php5_module modules/libphp5.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

When I tried to start it, it gave me the following. Huh? Another instruction doesn't work?
Code:
[root@test /]# /sbin/service httpd start
Starting httpd: httpd: Syntax error on line 150 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: cannot open shared object file: No such file or directory
                                                           [FAILED]

Last edited by grob115; 07-04-2010 at 11:02 AM.
 
Old 07-04-2010, 01:49 PM   #22
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Well does /etc/httpd/modules/libphp5.so exist?
 
Old 07-06-2010, 06:55 AM   #23
grob115
Member
 
Registered: Oct 2005
Posts: 541

Rep: Reputation: 32
Hello,

Good point, it's only available from the following paths:
[root@test /]# find . | grep libphp5
./usr/local/src/php-5.3.2/libs/libphp5.so
./usr/local/src/php-5.3.2/libs/libphp5.la
./usr/local/src/php-5.3.2/sapi/apache_hooks/libphp5.module.in
./usr/local/src/php-5.3.2/sapi/apache/libphp5.module.in
./usr/local/src/php-5.3.2/.libs/libphp5.lai
./usr/local/src/php-5.3.2/.libs/libphp5.so
./usr/local/src/php-5.3.2/.libs/libphp5.la
./usr/local/src/php-5.3.2/libphp5.la
./usr/local/apache2/modules/libphp5.so

I found 2 httpd.conf in the system in the following directories:
./etc/httpd/conf/httpd.conf
./usr/local/apache2/conf/httpd.conf

./etc/httpd/conf/httpd.conf
ServerRoot "/etc/httpd"

./usr/local/apache2/conf/httpd.conf
ServerRoot "/usr/local/apache2"


Both files have the "LoadModule php5_module modules/libphp5.so" line in them. However, the line in "./etc/httpd/conf/httpd.conf" was added by me. I think the key is to get the httpd daemon to read the "./usr/local/apache2/conf/httpd.conf" file instead of the "./etc/httpd/conf/httpd.conf" file.


For some reason when I tried to run "service httpd start" it's loading up from the /etc/httpd path rather than the /usr/local/apache2 path. How can I change this?

Last edited by grob115; 07-06-2010 at 09:59 AM.
 
Old 07-06-2010, 10:14 AM   #24
grob115
Member
 
Registered: Oct 2005
Posts: 541

Rep: Reputation: 32
Okay I did "yum erase httpd" and it removed the one that came with CenetOS. But the "service httpd <option>" doesn't work anymore and I have to use "/usr/local/apache2/bin/apachectl start" or "/usr/local/apache2/bin/apachectl stop"
 
Old 11-24-2010, 07:13 PM   #25
exoreich
LQ Newbie
 
Registered: Nov 2010
Posts: 1

Rep: Reputation: 0
Hi Folks,

I used this:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd

Saw it on a post on the MySQL Forum. http://dev.mysql.com/downloads/connector/php-mysqlnd/


Hope it helps and all the best.
 
Old 12-04-2010, 03:09 PM   #26
fender_gr
LQ Newbie
 
Registered: Apr 2008
Posts: 10

Rep: Reputation: 0
i knew that this is the best forum about linux... one more time that i solve my problem reading linuxquestions.org... thx guyz
 
Old 02-12-2011, 11:23 PM   #27
compsciguy
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 0
Thumbs up

Between installing libmysqlclient-dev and libxml2-dev (see http://www.linuxquestions.org/questi...ll-php-366764/) I was able to get PHP 5.5.9 running. Thanks!
 
Old 06-08-2011, 11:40 AM   #28
alela
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by steriojose View Post
Forget my post, it doesn't work, if you find the solution for red hat 4 enterprise edition I will thank you

Hello, I installed mysql 5 from the rpm's, and I have become crazy until I have proven the following thing:
./configure <blablabla> --with-MySQL
(write My-SQL, since the packages rpm of mysql 5 distinguish caps from small letters)
(sorry for my horrible english, i used the google translator), cheers from spain
Thank you steriojose, your solution worked for me in RHEL 5 php 5.3.6 and MySQL 5.0
 
Old 08-26-2011, 12:25 PM   #29
tanviet12
LQ Newbie
 
Registered: Aug 2011
Posts: 1

Rep: Reputation: Disabled
Thumbs up

Thanks activeco so much.. You have good answer!!!
 
Old 05-15-2018, 04:30 PM   #30
Shocker
LQ Newbie
 
Registered: May 2018
Location: localhost
Posts: 1

Rep: Reputation: Disabled
Sorry for bumping such an old topic but:

Quote:
Originally Posted by npj View Post
./configure --with-mysql=/usr/include/mysql/
This most likely needs to be
Code:
./configure --with-mysql=/usr
(at least for PHP 5.5.9+) since the mysql extension configure file config.m4 automatically adds include/mysql to the path
Code:
  if test -r $PHP_MYSQL/include/mysql/mysql.h; then
    MYSQL_DIR=$PHP_MYSQL
    MYSQL_INC_DIR=$PHP_MYSQL/include/mysql
    break
  elif test -r $PHP_MYSQL/include/mysql.h; then
    MYSQL_DIR=$PHP_MYSQL
    MYSQL_INC_DIR=$PHP_MYSQL/include
    break
  fi
Worked for me
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
configure php5 and mysql issue jiawj Programming 1 08-17-2005 03:34 PM
Error compiling PHP5 with MySQL Boby Linux - Software 3 09-10-2004 09:17 PM
./configure php5 error - log included Transition Linux - Newbie 4 07-16-2004 08:11 AM
./configure not finding header files mikeyt_333 Linux - Software 5 06-30-2004 06:09 PM
vmware error, cant find c header files artofluke Slackware 9 09-02-2003 07:35 AM

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

All times are GMT -5. The time now is 04:46 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