Forum Moderators: bakedjake

Message Too Old, No Replies

How to setup MySQL and PHP servers in different partitions?

         

manofwax

8:38 pm on Aug 17, 2004 (gmt 0)

10+ Year Member



Hi everyone,

Here is what i did:
I logged in as root, and then installed php4 and mysql.

question:
Does it mean i have php and mysql servers in the same partition?

what i want to do:
Under windows platforms, we can install different softwares in different partitions, rite? hm... so now i'm wondering if there's way to install php and mysql differently in different partitions.
and How?

Does this make sense? Thanks guy, i'm a linux virgin... haha...

MattyMoose

5:50 pm on Aug 18, 2004 (gmt 0)

10+ Year Member




Does it mean i have php and mysql servers in the same partition?

Most likely, yes... Most *NIX installers install things to
/usr
or
/usr/local
.

MySQL will be in something like /usr/local/mysql and PHP will be in /usr/local/php (each distro and *NIX installs things to different places -- you may have to hunt for them).

PHP isn't a "server" per se. It's a module that attaches to Apache, and is executed by Apache (or whatever webserver), not a listening/daemonized process that accepts incoming connections.


Under windows platforms, we can install different softwares in different partitions, rite? hm... so now i'm wondering if there's way to install php and mysql differently in different partitions.
and How?

By different partitions you mean like mysql is installed onto "D:" drive and PHP onto "E:" drive?

You can install them on difference partitions, but the question is why? What advantage is there that you're looking for with that kind of setup? If it's because you want to have MySQL datafiles on their own partition, you can easily do that by definining the data directory in MySQL to point to the different partition, without actually having to install all the libraries and binaries on a different partition.

I'd recommend leaving them in the default installation directory, otherwise you'll have to update your PATHs to execute the binaries (ie: mysqladmin), and everytime you build an application that needs either one, you'll have to add custome switches to search through those partitions to look for the MySQL or PHP libraries.

Does this make sense?

Not really. There's no need to install the apps on separate partitions. Like I said, if you want the MySQL DB files on a separate slice, I can see that, but not the binaries and libraries.

manofwax

6:28 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



Thanks Matty =)

manofwax

6:33 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



"I'd recommend leaving them in the default installation directory, otherwise you'll have to update your PATHs to execute the binaries (ie: mysqladmin), and everytime you build an application that needs either one, you'll have to add custome switches to search through those partitions to look for the MySQL or PHP libraries. "

I don't quite get this paragraph.
--"otherwise you'll have to update your paths to exectue the binaries"?
why? what paths?

--"everytime you build an application that needs either one"
what either one?

--"you will have to add custom switches..."
i'm wondering how to add those custome switches...

MattyMoose

7:33 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



I don't quite get this paragraph.

Basically when you type in "ls" to get a directory listing, your shell searches through the "PATH" variable until it finds the executable program, and runs it.
This saves you from having to type in "/bin/ls" every time you really just want "ls".

to see what your PATH currently is, type

echo $PATH
at the command line.


--"otherwise you'll have to update your paths to exectue the binaries"?
why? what paths?

What I'm saying is if you install MySQL, and all its binaries and libraries to /weird/path/mysql, and you want to run "mysqladmin", you'll have to either type in "/weird/path/mysql/bin/mysqladmin" or update your PATH variable to point to that directory.
It's not really a big deal, since you can create symlinks from "/usr/bin" (or whatever's currently in your PATH) to "/weird/path/mysql/bin". the Installer for MySQL may also create the symlinks for you, I'm not sure.


--"everytime you build an application that needs either one"
what either one?
--"you will have to add custom switches..."
i'm wondering how to add those custome switches...

Say you've got an app called "ABC", which depends on header files (called includes) and libraries from MySQL and PHP. The installer for ABC is not going to search through your whole hard-drive looking for "limysql.so" or "libphp.so" (".so" is a common extension for libraries -- like ".dll" in windows). It has a list of directories that get searched for these libraries. Again, you could add a custom switch when you run the "./configure" script. Something like: "--with-mysql-include-dir=/weird/path/mysql/include --with-mysql-lib-dir=/weird/path/mysql/lib" would be what you'd have to type in.

There are similar things to the $PATH variable that are used when configuring/building an app from source, things like CXX_FLAGS and LD_LIBRARY_PATH. It would also be better to edit your ld.so.conf file and re-running ldconfig. (have a look at that file now, and check out the man pages for ls.so.conf and ldconfig).

Anyway, I'm basically saying that it's more work than it needs to be, without having a really good argument for it.

-MM