hqlulu / php-handlersocket

Automatically exported from code.google.com/p/php-handlersocket
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Debian amd64 + Percona-Server + php-5.3.6 ... don't install #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, Thanks for client!
Replaced the server with i386 to amd64 and ceased install. 

my setup:
debian-6.0.1a-amd64-DVD-1.iso
//---------------------------------------------------------------
Percona:
//---------------------------------------------------------------
gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
gpg -a --export CD2EFD2A | apt-key add -
echo "deb http://repo.percona.com/apt lenny main" >> /etc/apt/sources.list
echo "deb-src http://repo.percona.com/apt lenny main" >> /etc/apt/sources.list
apt-get update
apt-get install percona-server-server-5.5 percona-server-client-5.5

mysql_secure_installation
1 - N,  2,3.. Y 

nano /etc/mysql/my.cnf
[mysqld]
# * HandlerSocket
loose_handlersocket_port = 9998 # the port number to bind to for read requests
loose_handlersocket_port_wr = 9999 # the port number to bind to for write 
requests
loose_handlersocket_threads = 16 # the number of worker threads for read 
requests
loose_handlersocket_threads_wr = 1 # the number of worker threads for write 
requests
open_files_limit = 65535 # to allow handlersocket to accept many concurrent 
connections, make open_files_limit as large as possible.
innodb_flush_log_at_trx_commit = 2

mysql -u root -p
mysql> 
install plugin handlersocket soname 'handlersocket.so';
//---------------------------------Query OK, 0 rows affected (0,02 sec)
mysql>show plugins;
+--------------------------------+----------+--------------------
| Name                           | Status   | Type
+--------------------------------+----------+--------------------
| binlog                         | ACTIVE   | STORAGE ENGINE
...
| handlersocket                  | ACTIVE   | DAEMON
+--------------------------------+----------+--------------------
29 rows in set (0,00 sec)
//---------------------------------HandlerSocket OK!

//---------------------------------------------------------------
nginx:
//---------------------------------------------------------------
aptitude install build-essential libpcre3 libpcre3-dev libpcrecpp0 libssl-dev 
zlib1g-dev

cd /usr/local/src
wget http://pushmodule.slact.net/downloads/nginx_http_push_module-0.692.tar.gz
tar -zxvf nginx_http_push_module-0.692.tar.gz
wget http://sysoev.ru/nginx/nginx-1.0.4.tar.gz
tar -zxvf nginx-1.0.4.tar.gz
cd /usr/local/src/nginx-1.0.4
./configure --user=www-data --group=www-data  
--add-module=/usr/local/src/nginx_http_push_module-0.692/ \
&& make && make install

nano /etc/init.d/nginx
-----------------------------------------------------------------------
#! /bin/sh

### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/nginx/sbin/nginx
NAME=nginx
DESC=nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
. /etc/default/nginx
fi

set -e

case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/nginx.pid 
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/nginx.pid 
--exec $DAEMON
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile /usr/local/nginx/logs/nginx.pid 
--exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile /usr/local/nginx/logs/nginx.pid 
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
reload)
echo -n "Reloading $DESC configuration: "
start-stop-daemon --stop --signal HUP --quiet --pidfile 
/usr/local/nginx/logs/nginx.pid --exec $DAEMON
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0
-----------------------------------------------------------------------
chmod +x /etc/init.d/nginx
/usr/sbin/update-rc.d -f nginx defaults

chmod -R 777 /usr/local/nginx/conf/

Теперь управлять сервером с помощью 
следующих команд: 
/etc/init.d/nginx start
/etc/init.d/nginx restart
/etc/init.d/nginx stop

//---------------------------------------------------------------
php
//---------------------------------------------------------------
apt-get install autoconf2.13 libmysqlclient-dev libcurl4-openssl-dev 
libjpeg62-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev 
libxslt1-dev libbz2-dev libxml2-dev bzip2 libevent-dev libltdl-dev 
libmagickwand-dev imagemagick

mkdir ~/lemp
cd ~/lemp 
wget http://ru.php.net/distributions/php-5.3.6.tar.gz
tar xzvf php-5.3.6.tar.gz
cd ~/lemp/php-5.3.6

./buildconf --force

./configure \
  --prefix=/opt/php5 \
  --with-config-file-path=/opt/php5/etc \
  --with-config-file-scan-dir=/opt/php5/etc/conf.d \
  --with-curl \
  --with-pear \
  --with-gd \
  --with-jpeg-dir \
  --with-png-dir \
  --with-zlib \
  --with-xpm-dir \
  --with-freetype-dir \
  --with-t1lib \
  --with-mcrypt \
  --with-mhash \
  --with-mysql \
  --with-mysqli \
  --with-pdo-mysql \
  --with-openssl \
  --with-xmlrpc \
  --with-xsl \
  --with-bz2 \
  --with-gettext \
  --with-fpm-user=www-data \
  --with-fpm-group=www-data \
  --disable-debug \
  --enable-fpm \
  --enable-exif \
  --enable-wddx \
  --enable-zip \
  --enable-bcmath \
  --enable-calendar \
  --enable-ftp \
  --enable-mbstring \
  --enable-soap \
  --enable-sockets \
  --enable-sqlite-utf8 \
  --enable-shmop \
  --enable-dba \
  --enable-sysvsem \
  --enable-sysvshm \
  --enable-sysvmsg

make && make install

echo 'if [ -d "/opt/php5/bin" ] && [ -d "/opt/php5/sbin" ]; then
    PATH="$PATH:/opt/php5/bin:/opt/php5/sbin"
fi' >> /etc/bash.bashrc

export PATH="$PATH:/opt/php5/bin:/opt/php5/sbin"

mkdir /var/www && chown -R www-data:www-data /var/www \
&& mkdir /var/log/php-fpm \
&& chown -R www-data:www-data /var/log/php-fpm \
&& cp -f php.ini-production /opt/php5/etc/php.ini \
&& chmod 644 /opt/php5/etc/php.ini \
&& cp /opt/php5/etc/php-fpm.conf.default /opt/php5/etc/php-fpm.conf \
&& cp -f sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm \
&& chmod 755 /etc/init.d/php-fpm \
&& update-rc.d -f php-fpm defaults

nano /opt/php5/etc/php-fpm.conf
[global]
pid = run/php-fpm.pid
[www]
listen = /tmp/php-fpm.sock
uncomment
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35

//---------------------------------------------------------------
php-handlersocket
//---------------------------------------------------------------
cd /usr/local/
wget –c 
http://php-handlersocket.googlecode.com/files/php-handlersocket-0.2.0.tar.gz
tar -xzf php-handlersocket-0.2.0.tar.gz
cd /usr/local/php-handlersocket
phpize
./configure
make 

/bin/sh /usr/local/php-handlersocket/libtool --mode=compile c++  -I. 
-I/usr/local/php-handlersocket -DPHP_ATOM_INC 
-I/usr/local/php-handlersocket/include -I/usr/local/php-handlersocket/main 
-I/usr/local/php-handlersocket -I/opt/php5/include/php 
-I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM 
-I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext 
-I/opt/php5/include/php/ext/date/lib -I/usr/include/handlersocket  
-DHAVE_CONFIG_H  -g -O2   -c /usr/local/php-handlersocket/handlersocket.cc -o 
handlersocket.lo 
mkdir .libs
 c++ -I. -I/usr/local/php-handlersocket -DPHP_ATOM_INC -I/usr/local/php-handlersocket/include -I/usr/local/php-handlersocket/main -I/usr/local/php-handlersocket -I/opt/php5/include/php -I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM -I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext -I/opt/php5/include/php/ext/date/lib -I/usr/include/handlersocket -DHAVE_CONFIG_H -g -O2 -c /usr/local/php-handlersocket/handlersocket.cc  -fPIC -DPIC -o .libs/handlersocket.o
/usr/local/php-handlersocket/handlersocket.cc:266: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc: In function ‘void 
zim_handlersocket___construct(int, zval*, zval**, zval*, int)’:
/usr/local/php-handlersocket/handlersocket.cc:701: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc: In function ‘void 
zim_handlersocket_openIndex(int, zval*, zval**, zval*, int)’:
/usr/local/php-handlersocket/handlersocket.cc:756: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc: In function ‘void 
zim_handlersocket_executeSingle(int, zval*, zval**, zval*, int)’:
/usr/local/php-handlersocket/handlersocket.cc:812: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc: In function ‘void 
zim_handlersocket_executeMulti(int, zval*, zval**, zval*, int)’:
/usr/local/php-handlersocket/handlersocket.cc:833: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc: In function ‘void 
zim_handlersocket_executeUpdate(int, zval*, zval**, zval*, int)’:
/usr/local/php-handlersocket/handlersocket.cc:1066: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc:1073: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc: In function ‘void 
zim_handlersocket_executeDelete(int, zval*, zval**, zval*, int)’:
/usr/local/php-handlersocket/handlersocket.cc:1096: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc:1103: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc: In function ‘void 
zim_handlersocket_executeInsert(int, zval*, zval**, zval*, int)’:
/usr/local/php-handlersocket/handlersocket.cc:1119: warning: deprecated 
conversion from string constant to ‘char*’
/usr/local/php-handlersocket/handlersocket.cc:1127: warning: deprecated 
conversion from string constant to ‘char*’
/bin/sh /usr/local/php-handlersocket/libtool --mode=link gcc -DPHP_ATOM_INC 
-I/usr/local/php-handlersocket/include -I/usr/local/php-handlersocket/main 
-I/usr/local/php-handlersocket -I/opt/php5/include/php 
-I/opt/php5/include/php/main -I/opt/php5/include/php/TSRM 
-I/opt/php5/include/php/Zend -I/opt/php5/include/php/ext 
-I/opt/php5/include/php/ext/date/lib -I/usr/include/handlersocket  
-DHAVE_CONFIG_H  -g -O2   -o handlersocket.la -export-dynamic -avoid-version 
-prefer-pic -module -rpath /usr/local/php-handlersocket/modules  
handlersocket.lo -lstdc++ -Wl,-rpath,/usr/include/handlersocket/lib 
-L/usr/include/handlersocket/lib -lhsclient
gcc -shared  .libs/handlersocket.o  -lstdc++ -L/usr/include/handlersocket/lib 
-lhsclient  -Wl,-rpath -Wl,/usr/include/handlersocket/lib -Wl,-soname 
-Wl,handlersocket.so -o .libs/handlersocket.so
/usr/bin/ld: cannot find -lhsclient
collect2: ld returned 1 exit status
make: *** [handlersocket.la] Error 1

Original issue reported on code.google.com by Duncon...@gmail.com on 21 Jun 2011 at 11:46

GoogleCodeExporter commented 8 years ago
It looks like you've installed Percona Server and HandlerSocket from the 
Percona repo, in which case you won't have the HandlerSocket client library or 
header files, which will mean you can't build php-handlersocket (hence ld 
complaining that it can't find hsclient).

You'll need to download the latest version of the HandlerSocket source from 
https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/ to compile and 
install it locally so that you've got a copy of the development files that 
php-handlersocket can refer to.

Original comment by mattwar...@gmail.com on 22 Jun 2011 at 5:18