Установка многосерча как модуля к php под debian sarge/etch
mnogosearch as php module on debian sarge/etch
apt-get install libapache-mod-php4 php4-cli php4-mysql php4-dev php4-xslt automake make build-essential
apt-get install php4-pear
apt-get install libmysqlclient15-dev (libmysqlclient12-dev на sarge)
apt-get install mysql-server
apt-get install mnogosearch-mysql mnogosearch-dev
Если авто конфигурация не удалась, то создаём базу mnogosearch ( или какую вам нужно ) и потом делаем
dpkg-reconfigure mnogosearch-common
cd /tmp/
wget "
http://pecl.php.net/get/mnogosearch-1.0.0.tgz"
(берётся здесь -
http://pecl.php.net/package/mnogosearch, на момент написания последняя версия 1.0.0 )
tar -xzf mnogosearch-1.0.0.tgz
cd mnogosearch-1.0.0
ln -s /usr/include/php4/ /usr/include/php
phpize
./configure --with-mnogosearch=/usr --with-mysql=/usr
Если Etch , то открыть /usr/include/udm_autoconf.h, найти в нем
/* #undef HAVE_PGSQL */
и раскомментировать, чтобы стало
#undef HAVE_PGSQL
Если sarge то:
root@searchbla:/tmp# diff -Naur udm_config.h /usr/include/udm_config.h
--- udm_config.h 2005-03-15 02:57:52.000000000 +0300
+++ /usr/include/udm_config.h 2008-01-10 18:03:45.000000000 +0300
@@ -74,40 +74,40 @@
/* #undef HAVE_MYSQL */
/* Define if you want to use PostgreSQL */
-/* #undef HAVE_PGSQL */
+#undef HAVE_PGSQL
/* Define if you want to use iODBC */
-/* #undef HAVE_IODBC */
+#undef HAVE_IODBC
/* Define if you want to use unixODBC */
-/* #undef HAVE_UNIXODBC */
+#undef HAVE_UNIXODBC
/* Define if you want to use IBM DB2 */
-/* #undef HAVE_DB2 */
+#undef HAVE_DB2
/* Define if you want to use Solid SQL Server */
-/* #undef HAVE_SOLID */
+ #undef HAVE_SOLID
/* Define if you want to use OpenLink ODBC (Virtuoso) */
-/* #undef HAVE_VIRT */
+#undef HAVE_VIRT
/* Define if you want to use EasySoft ODBC */
-/* #undef HAVE_EASYSOFT */
+#undef HAVE_EASYSOFT
/* Define if you want to use SAPDB ODBC library */
-/* #undef HAVE_SAPDB */
+#undef HAVE_SAPDB
/* Define if you want to use Interbase SQL Server */
-/* #undef HAVE_IBASE */
+#undef HAVE_IBASE
/* Define if you want to use CT-LIB SyBase SQL Server */
-/* #undef HAVE_CTLIB */
+#undef HAVE_CTLIB
/* Define if you want to use sqlite */
-/* #undef HAVE_SQLITE */
+#undef HAVE_SQLITE
/* Define if you want to use Oracle 8 SQL Server */
-/* #undef HAVE_ORACLE8 */
+#undef HAVE_ORACLE8
/* Define VERSION_ID */
#define UDM_VERSION_ID 30231
make && make install
ls -la /usr/lib/php4/20050606+lfs/
mcedit /etc/php4/apache/conf.d/mnogosearch.ini (/etc/php4/apache/php.ini для sarge )
Смотрим в вывод php -m|grep mnogo - должен присутствовать наш модуль
cd /var/www/
echo "" > phpinfo.php
/etc/init.d/apache restart
и lynx
http://192.168.0.257/phpinfo.php - так же должен присутствовать модуль mnogosearch
обновляем php.ini, делал только в sarge, в etch примерно тоже самое, только расширения прописываются в conf.d
root@search:/etc/mnogosearch# diff -Naur /usr/share/php4/php.ini-dist /etc/php4/apache/php.ini
--- /usr/share/php4/php.ini-dist 2007-06-30 18:42:20.000000000 +0400
+++ /etc/php4/apache/php.ini 2008-01-15 14:00:53.211113256 +0300
@@ -263,18 +263,18 @@
;
; - Show only errors
;
-;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
+error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
; - Show all errors except *for* notices
;
-error_reporting = E_ALL & ~E_NOTICE
+;error_reporting = E_ALL
; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
-display_errors = On
+display_errors = Off
; Even when display_errors is on, errors that occur during PHP's startup
; sequence are not displayed. It's strongly recommended to keep
@@ -284,11 +284,11 @@
; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you're strongly advised to use error logging in place of
; error displaying on production web sites.
-log_errors = Off
+log_errors = On
; Set maximum length of log_errors. In error_log information about the source is
; added. The *default* is 1024 and 0 allows to not apply any maximum length at all.
-log_errors_max_len = 1024
+log_errors_max_len = 8192
; Do not log repeated messages. Repeated errors must occur in same file on same
; line until ignore_repeated_source is set true.
@@ -326,7 +326,7 @@
;error_append_string = ""
; Log errors to specified file.
-;error_log = filename
+error_log = /var/log/apache/phperrors.log
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
@@ -362,7 +362,7 @@
; You should *do* your best to write your scripts so that they *do* not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, *if* the code is not very well thought of.
-register_globals = Off
+register_globals = On
; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information). If you don't use these variables, you
@@ -397,7 +397,7 @@
;
; PHP's built-in default is text/html
default_mimetype = "text/html"
-;default_charset = "iso-8859-1"
+default_charset = "windows-1251"
; Always populate the $HTTP_RAW_POST_DATA variable.
;always_populate_raw_post_data = On
@@ -1071,3 +1071,6 @@
; Local Variables:
; tab-width: 4
; End:
+extension=mysql.so
+extension=mnogosearch.so
+extension=xslt.so
Обновление:
root@search:~# crontab -l
0 3 * * * /usr/sbin/indexer -e -N 10 -c 82800 > /dev/null
Если нужно создать базу для mnogosearch, запускать
indexer -Ecreate - по умолчанию читает /etc/mnogosearch/indexer.conf