compiling php with "--with-mysql" but for a remote database
I am setting up an apache/php instance which will be connecting to a different box for its mysql. I just wanted to know whether I am still required to compile PHP with the "--with-mysql" flag to properly set it up for use with mysql?
The only problem is that I have to install the mysql client locally as the libphp5.so is clearly looking for the 'libmysqlclient.so.15' library in the location I define with the "--with-mysql" flag ( e.g."--with-mysql=/usr/local/mysql" )
If I elect to remove that configure option, what would be the process of manually linking php to a remote mysql ?
MySQL has to be installed on the same server if it's required by a PHP extension (mysql, mysqli) even if your MySQL DB is remote...
Use the minimal compile flag for MySQL to compile MySQL with the bare minimum, although just a suggestion, compiling MySQL is a tedious job... I would install a MySQL client as is on the same server, and use PHP's mysqli extension to connect to remote DBs.
The overhead would be the memory usage of MySQL running in the memory... But you can configure it to use minimal resources.
Let me clarify the situations...Compiling PHP using the "--with-mysql" flag DOES NOT compile MySQL on the server, it compiles the extension that lets you connect to MySQL. In order to connect to a MySQL database you need to compile the extension.
I will be using the sunfreeware mysql package so wont be compiling it at all
logic_earth : The question was more about whether I need to have any mysql components (libraries, binaries etc) installed locally if I compile php with --with-mysql (or indeed the mysqli equivalent) flag. My database is on another server and ideally i dont really want to install any mysql packages on this server as it will only be running apache/php ...