Skip to content
chobie edited this page Sep 17, 2012 · 5 revisions

Welcome to the php-uv wiki!

Installing php-uv

git clone https://github.com/chobie/php-uv.git --recursive
cd php-uv
(cd libuv && make)
phpize
./configure
make
make install
# add `extension=uv.so` to your php.ini

php-uv doesn't use threading feature. we don't need TSRM version of php. someday we need TSRM.

64bit machine

you need to add -fPIC flag to libuv/Makefile before building libuv

chobie@ubuntu:~/src/php-uv/libuv$ git diff
diff --git a/Makefile b/Makefile
index cf1e788..f3da5c4 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ ifdef MSVC
 uname_S := MINGW
 endif
 
-CPPFLAGS += -Iinclude -Iinclude/uv-private
+CPPFLAGS += -Iinclude -Iinclude/uv-private -fPIC
 
 CARES_OBJS =
 CARES_OBJS += src/ares/ares__close_sockets.o

Known Issues

gcc 4.6.3 (Ubuntu Ubuntu/Linaro)

can't link -lrt and -lpthread. please use 4.4.7 instead of 4.6.3 at this time.

chobie@ubuntu:~/src/php-uv$ /usr/bin/gcc-4.4 -v -shared  .libs/php_uv.o .libs/uv.o http-parser/.libs/http_parser.o  -lrt  -Wl,libuv/uv.a -Wl,-soname -Wl,uv.so -o .libs/uv.so
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.7-1ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-1ubuntu2) 
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.4.7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.7/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-shared' '-o' '.libs/uv.so' '-mtune=generic'
 /usr/lib/gcc/x86_64-linux-gnu/4.4.7/collect2 --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -shared -o .libs/uv.so -z relro /usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.4.7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/4.4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../.. .libs/php_uv.o .libs/uv.o http-parser/.libs/http_parser.o -lrt libuv/uv.a -soname uv.so -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.4.7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.4.7/../../../x86_64-linux-gnu/crtn.o

Test plan

test plan