views:

50

answers:

2

I have a server that is running live (in process of turning it into a dev server but need some stuff off it first) so we don't want to recompile php to break anything.

On the new server we have the dynamic extensions of mysql.so and mysqli.so I haven't been able to find anything about the details of building one myself, so copied them over to the old server. On the current server, it doesn't have MySQL configured with php. MySQL is installed on the machine but was being used on a now unused service. The intention is to use MySQL database on a remote server.

I have added the lines to the php.ini

extension=mysql.so  
extension=mysqli.so

I end up getting this error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/mysqli.so' - libmysqlclient.so.15:cannot open shared object file: No such file or directory in Unknown on line 0

I've moved a copy of that file to /usr/lib/mysql/ but am still receiving the error.

Is there anything I am supposed to do to to allow PHP to run MySQL (or MySQLi) without having to risk recompiling on a live server?

+1  A: 

Looks like your file paths are different. Is mysql.so in:

/usr/local/lib/php/extensions/mysqli.so

?

Byron Whitlock
Yes. The ini also has the setting extensions_dir = "/usr/local/lib/php/extensions/"
Special K
Where is " libmysqlclient.so" at?
Byron Whitlock
A: 

It is always better to install extensions and PHP itself from packages or ports, not to compile sources your self. What is your OS? In your case it seems, there is a problem initializing libmysqlclient library, that throws errors. Can you start mysql client tool from command line on server? Does it work properly?

FractalizeR
I agree with the packages, but that's not my call (my bosses).Not sure what the OS is exactly. It's a version of Linux with command line only.I don't really want to start MySQL on the web server, only be able to call queries to a remote db server. Does it have to be installed on the web server to do that?
Special K
You need libmysqlclient to work with MySQL from PHP. MySQL server itself is not necessary. But libmysqlclient version should match the version of MySQL server you are calling through it.
FractalizeR