Showing posts with label make. Show all posts
Showing posts with label make. Show all posts

Wednesday, February 24, 2010

PHP

I was unable to install today PECL extention PDO_MYSQL via

sudo pecl install PDO_MYSQL


The problem was that after configure, make can't find mysql header files.

...
In file included from /tmp/pear/temp/PDO_MYSQL/pdo_mysql.c:31:
/tmp/pear/temp/PDO_MYSQL/php_pdo_mysql_int.h:25:19: mysql.h: No such file or directory
In file included from /tmp/pear/temp/PDO_MYSQL/pdo_mysql.c:31:
/tmp/pear/temp/PDO_MYSQL/php_pdo_mysql_int.h:36: error: syntax error before "MYSQL"
...


So I learned how to make an extension manually.
I ran locate mysql.h, copyed all mysql headers from there to current folder and now you can make it

phpize --clean
phpize
./configure
make


make install won't worked for me.
pdo_mysql.so placed in modules dir, copy it to extentions dir (php -i | grep extension_dir) and enable in php.ini.

These steps will not add PDO_MYSQL under the PEAR, so you need to maintain it by yourself. But to update list of installed packages, you can do this trick

sudo pecl install -rB pdo_mysql

-r means do not install files, only register the package as installed
-B means don't build C extensions

Some other good to read links
Topic : pdo_mysql.so driver Installation

Saturday, February 2, 2008

nginx 0.5.35

http://sysoev.ru/nginx/getting_started.html
http://sysoev.ru/nginx/docs/install.html

wget http://sysoev.ru/nginx/nginx-0.5.35.tar.gz
tar xzvf nginx-0.5.35.tar.gz

wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.6.tar.bz2
wget http://heanet.dl.sourceforge.net/sourceforge/pcre/pcre-7.6.tar.bz2
tar xjvf pcre-7.6.tar.bz2

wget http://www.zlib.net/zlib-1.2.3.tar.bz2
tar xjvf zlib-1.2.3.tar.bz2

wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.6.tar.gz
tar xzvf mod_rpaf-0.6.tar.gz
cd mod_rpaf-0.6
/usr/local/httpd/bin/apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
cd ..

cd nginx-0.5.35
make clean
./configure --with-zlib=../zlib-1.2.3 --with-pcre=../pcre-7.6
make -j4
make install



/usr/local/nginx/sbin/nginx -V
/usr/local/nginx/sbin/nginx
ps ax -o pid,ppid,user,%cpu,vsz,wchan,command|egrep '(nginx|PID)'

cat /usr/local/nginx/conf/nginx.conf

Saturday, September 15, 2007

make nginx (command-line)

help resources:
getting started
install

getting all sorces:
wget http://sysoev.ru/nginx/nginx-0.5.31.tar.gz
tar xzvf nginx-0.5.31.tar.gz

wget http://ovh.dl.sourceforge.net/sourceforge/pcre/pcre-7.3.tar.bz2
tar xjvf pcre-7.3.tar.bz2

wget http://www.zlib.net/zlib-1.2.3.tar.bz2
tar xjvf zlib-1.2.3.tar.bz2

wget http://stderr.net/apache/rpaf/download/mod_rpaf-0.5.tar.gz
tar xzvf mod_rpaf-0.5.tar.gz

this is for transferring IP address of user to backend.
/usr/local/httpd/bin/apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c

cd nginx-0.5.31
make clean
./configure --with-zlib=../zlib-1.2.3 --with-pcre=../pcre-7.3
make -j4
make install

Friday, June 1, 2007

step 3 — compiling php 5.2.3 on debian linux

this is last step before you get complete LAMP system.

before you start anything, please point your browser to install notes from php site. you right man if you always have a fresh copy of off-line docs (best one).

first, you need to get php source code. i like swedish locations (good speed) and smaller bz2 compressions, so chose where do you want to save and extract after files and run this:
wget http://se.php.net/get/php-5.2.3.tar.bz2/from/this/mirror

now in that dir we need decompress archive. this will create "php-5.2.3" directory
tar -xvvf php-5.2.3.tar.bz2

this step is not necessary if you build it for a first time, but after you sholud do this (for finding out, why my new compile not work properly with all options that i added - i spent all day, just for this simple thing)
make clean or make distclean

cd to new folder and try to check your config
./configure --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/httpd/bin/apxs --with-mysqli --with-gd --with-zlib --enable-mbstring --with-freetype-dir --enable-gd-native-ttf --with-jpeg-dir --enable-bcmath

it is never (i think) passed on first time ;-) so for this my conf i was need these packages: libmysqlclient14, libmysqlclient14-dev, libxml2, libxml2-dev, libpng3, libjpeg62, libjpeg62-dev, libgd-dev, libfreetype6-dev

also, it was a little trouble to understand, why php cant see mysql installation, this should help (we put path to mysql into linux environment PATH):
export PATH=/usr/local/mysql/bin:$PATH

if configure passed, we can smile and start make phase. (for my double P-II 350 MHz it took ~30 mins)
make -j4
-j option is for SMP systems (more than one CPU). it's CPU_COUNT*2

i found that PHP team provide us some testcases, so we can use it for find out any compiling bugs or smthing
make test

before install phase, make sure that apache is not running (ps ax | grep httpd)
/etc/init.d/apachectl stop
make install

export CFLAGS="-O3 -msse -mmmx -march=pentium3 -mcpu=pentium3 -funroll-loops -mfpmath=sse -fomit-frame-pointer"


--with-mysql
--with-mysqli
--with-apxs2=/usr/local/httpd/bin/apxs
--with-freetype-dir=/usr/include/freetype2/freetype
--with-tidy (libtidy, tidy, tidy-dev)
--enable-bcmath = Enable bc style precision math functions
--enable-memory-limit (prior to 5.2.1) for memory_get_usage(), memory_get_peak_usage() and 'memory_limit' configuration directive.





http://www.opennet.ru/base/net/lamp_slackware.txt.html

http://www.opennet.ru/opennews /art.shtml?num=8508

Thursday, May 17, 2007

step 2 — compiling apache 2.0.59 on debian linux

download source from apache (switzerland mirror, you can choose best for you here)
wget http://mirror.switch.ch/mirror/apache/dist/httpd/httpd-2.0.59.tar.bz2

extracting from archive
tar -xvvf httpd-2.0.59.tar.bz2

change into dir
cd httpd-2.0.59

try to config source. here i specify modules for me: rewrite - for good-looking urls, deflate - for compression, headers - to change headers, info - apache informations (i use it for debug).
./configure --prefix=/usr/local/httpd --enable-rewrite --enable-deflate --enable-headers --enable-info

if you passed configure, can go to make. (for dual PII-350, 512 Mb it takes ~10 min)
make -j4

finally, install
make install

editing conf
vi /usr/local/httpd/conf/httpd.conf

if you want apache auto start:
copy start program to init.d
cp /usr/local/httpd/bin/apachectl /etc/init.d
update startup conf
update_rc.d apachectl defaults 19

test run
/etc/init.d/apachectl start

install instructions config help

/usr/local/httpd/conf/httpd .conf
/usr/local/httpd/bin/apachectl start

another help links
apachedev.ru

step 1 — compiling mysql 5.0.41 on debian linux

mysql help about install from source

wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.41.tar.gz/from/http://mirror.switch.ch/ftp/mirror/mysql/

tar -xvvf mysql-5.0.41.tar.gz

./configure --prefix=/usr/local/mysql --with-collation=latin1_general_ci

packages that may be need: libncurses5-dev

make -j4

make install

useful options:
--localstatedir=/usr/local/mysql/data
--enable-thread-safe-client
--with-low-memory
--prefix=/usr/local/mysql
--with-charset=latin1
--with-collation=latin1_general_ci
--with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
--with-openssl
--with-mysql-user=mysql
--enable-assembler
--with-mysqld-ldflags=-all-static # not for user-defined functions
--with-unix-socket-path=/tmp/mysql.sock
Where to put the unix-domain socket. SOCKET must be
an absolute file name.

after all done, check your /etc/mysql/my.cnf (server specific options) and /etc/my.cnf (global options) for same socket path. i found that in global conf, socket placed in /tmp/mysql.sock, but server specific - /var/run/mysqld/mysqld.sock. that make error when you trying to run mysql tool. if you do not want to change - workaround is to use "-S socket_path" .

Wednesday, May 16, 2007

step 0 — before compiling LAMP on debian linux

before you start any installation, please, update you system. it very helpful - cause you will use during "make" lot of tools such as gcc, libxml, etc.

apt-get update

apt-get upgrade

you probable need root access for linux while all future steps (# sign).