Discussion:
[PHP-INSTALL] MySql running on other server
John Moore
2009-01-10 01:47:09 UTC
Permalink
Newbie here...

Working on a test install of php..

CentOS4.7
Apache 2.0.59
php.5.2.8

I want to be able to access a MySql database running on another server.
Therefore I don't think I use the --with-mysql.. based on what I have
read thus far..

Correct..

That does not appear to be address in the docs so is there something
else I should know about doing this..?


Thanks for the help..

John..
Daniel Brown
2009-01-10 17:49:02 UTC
Permalink
Post by John Moore
I want to be able to access a MySql database running on another server.
Therefore I don't think I use the --with-mysql.. based on what I have read
thus far..
Correct..
Not correct.

You'll need to add MySQL support to your PHP installation with
--with-mysql, but you won't need to run a MySQL server on the same
machine.
Post by John Moore
That does not appear to be address in the docs so is there something else I
should know about doing this..?
You'll then need to configure the MySQL server to allow
connections from your web server and write your script to do the
connection - both of which are out of the scope of this particular
list. I'm sure you're aware how to do both anyway.
--
</Daniel P. Brown>
***@parasane.net || ***@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
John B. Moore
2009-01-10 18:23:13 UTC
Permalink
Post by Daniel Brown
You'll need to add MySQL support to your PHP installation with
--with-mysql, but you won't need to run a MySQL server on the same
machine.
Thanks... I obviously misunderstood what I was reading.. It saw a lot of
examples where

--with-mysql=[pathhere]

...was indicated.. Thereby suggesting that this configure switch was
for a local install of mysql..
Post by Daniel Brown
You'll then need to configure the MySQL server to allow
connections from your web server and write your script to do the
connection - both of which are out of the scope of this particular
list. I'm sure you're aware how to do both anyway.
Correct...
John B. Moore
2009-01-11 00:33:02 UTC
Permalink
you don't have to install mysql, but you have to build it to the
point that the headers and libraries that php needs are available. i
think that installing the mysql-devel rpm for centos may be enough.
Ok.. installed the mysql-devel rpm (could not find a centos specific rpm)

At the end of the "make" I'm getting a make error:

gcc: /usr/lib/mysql/libmysqlclient.so: No such file of directory..

in that directory I do have..

libmysqclient.so.10.0.0

... I seem to remember in this situation that one creates a symlink from
the latest version to the base name.. i.e.

ln -s /usr/lib/mysql/libmysqlclient.so.10.0.0
/usr/lib/mysql/libmysqlclient.so

I don't do this sort of thing regularly so could some one confirm that
as a solution in this case..

Or...?

Thanks

John..
Daniel Brown
2009-01-11 00:49:03 UTC
Permalink
Post by John B. Moore
Ok.. installed the mysql-devel rpm (could not find a centos specific rpm)
You don't have to do that at all. Did you install PHP from an
RPM? I thought you were compiling from source.

If it's an RPM, just install `php-mysql`, which you can find on
http://rpmfind.net/.

Or, if you have yum or smart on there, just install it like that.
--
</Daniel P. Brown>
***@parasane.net || ***@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
Daniel Brown
2009-01-11 00:57:11 UTC
Permalink
... I seem to remember in this situation that one creates a symlink from the
latest version to the base name.. i.e.
ln -s /usr/lib/mysql/libmysqlclient.so.10.0.0
/usr/lib/mysql/libmysqlclient.so
I'm sorry, John, I mis-read your email. Yes, that would be the
best way of doing it (it's how I do it myself).
--
</Daniel P. Brown>
***@parasane.net || ***@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!
Loading...