自宅で飼っているLinuxサーバにXOOPSをインストールしました。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
・結果的に、すでにRPMでインストールされていたapache,PHPをアンインストールするはめになりました。PHPのコンパイル時のコンフィグにおいて、apacheからPHPを使用するためとMySQLサポートのため、
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql=/usr/local/mysql'
としてソースからコンパイルしました。
・apacheとPHPインストール後、下記を走らせておくといいかと思います。
・PHP上でMySQLを使用するために、下記のスクリプトのようなものを用意するといいかと思います。
MySQL TEST
<?php
if (!($cn = mysql_connect("localhost", "username", "password"))) {
die;
}if (!(mysql_select_db("dbname"))) {
die;
}$sql = "select * from testtable";
if (!($rs = mysql_query($sql))) {
die;
}while ($item = mysql_fetch_array($rs)) {
print "${item['key1']} ";
print "${item['data1']}";
}mysql_close($cn);
print "
OK
";
?>
・各モジュールのバージョンは下記のとおり
# /usr/local/apache2/bin/httpd -v
Server version: Apache/2.0.54
Server built: Aug 17 2005 19:36:54# php -v
PHP 4.4.0 (cli) (built: Aug 17 2005 20:30:53)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies# mysqladmin version -uuser -ppassword
mysqladmin Ver 8.40 Distrib 4.0.25, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL licenseServer version 4.0.25-standard-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/lib/mysql/mysql.sock
(以下略)