OpenWrt Forum Archive

Topic: Packages updates : SQLite 3.3.17, PHP 5.2.2, LibXML2 patch

The content of this topic has been archived on 17 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I updated the PHP5 package to latest release 5.2.2, and added a lot of customization options (XML modules).
To compile properly the DOM extension it will require a recompile of libxml2 with more features (c14n had to be added), else link error.
There is also the package for the latest release of SQLite3, which can now be used trough PDO (since PHP 5.1).

Please note :
-currently the PDO module for mysql is broken (missing a header file). However the regular mysql module compiles properly (not tested).
-in the FastCGI build, there is a lighttpd config file for php to run out of the box (just rename lighttpd.conf.php into lighttpd.conf), and don't forget to uncomment the extensions sections in the php.ini file to have modules loaded.
-updated the php startup script, now it looks like other kamikaze startup scripts

Find the sources here : http://aorlinsk2.free.fr/openwrt/kamikaze/ and feel free to integrate in trunk.

Anael

(Last edited by aorlinsk on 13 May 2007, 21:53)

excellent! Compiling 'as we speak'.

Please create tickets on https://dev.openwrt.org with patches against the svn tree for easy inclusion.

when I checkout Kamikaze (r7252) and replace the files found at http://aorlinsk2.free.fr/openwrt/kamikaze/ with those in Kamikaze, compiling fails. Below is the log file. Any suggestions?

thanks!

make -C php5 compile
find: /usr/local/src/openwrt/trunk/build_mipsel/php-5.2.2: No such file or directory
make[3]: Entering directory `/usr/local/src/openwrt/trunk/feeds/packages/lang/php5'
bzcat /usr/local/src/openwrt/trunk/dl/php-5.2.2.tar.bz2 | /bin/tar -C /usr/local/src/openwrt/trunk/build_mipsel/php-5.2.2/.. -xf -

Applying ./patches/001-configure_cross.patch using plaintext:
patching file configure
Hunk #1 succeeded at 14248 with fuzz 1 (offset -671 lines).
Hunk #2 FAILED at 44904.
Hunk #3 succeeded at 51679 with fuzz 1 (offset -658 lines).
1 out of 3 hunks FAILED -- saving rejects to file configure.rej
Patch failed!  Please fix ./patches/001-configure_cross.patch!
make[3]: *** [/usr/local/src/openwrt/trunk/build_mipsel/php-5.2.2/.prepared_9a29af10e85e4538a4969bc9817d89f2] Error 1
make[3]: Leaving directory `/usr/local/src/openwrt/trunk/feeds/packages/lang/php5'
make[2]: *** [php5-compile] Error 2
make[2]: Leaving directory `/usr/local/src/openwrt/trunk/package'
make[1]: *** [package/compile] Error 2
make[1]: Leaving directory `/usr/local/src/openwrt/trunk'
make: *** [world] Error 2
bowlby wrote:

when I checkout Kamikaze (r7252) and replace the files found at http://aorlinsk2.free.fr/openwrt/kamikaze/ with those in Kamikaze, compiling fails. Below is the log file. Any suggestions?

thanks!

make -C php5 compile
find: /usr/local/src/openwrt/trunk/build_mipsel/php-5.2.2: No such file or directory
make[3]: Entering directory `/usr/local/src/openwrt/trunk/feeds/packages/lang/php5'
bzcat /usr/local/src/openwrt/trunk/dl/php-5.2.2.tar.bz2 | /bin/tar -C /usr/local/src/openwrt/trunk/build_mipsel/php-5.2.2/.. -xf -

Applying ./patches/001-configure_cross.patch using plaintext:
patching file configure
Hunk #1 succeeded at 14248 with fuzz 1 (offset -671 lines).
Hunk #2 FAILED at 44904.
Hunk #3 succeeded at 51679 with fuzz 1 (offset -658 lines).
1 out of 3 hunks FAILED -- saving rejects to file configure.rej
Patch failed!  Please fix ./patches/001-configure_cross.patch!
make[3]: *** [/usr/local/src/openwrt/trunk/build_mipsel/php-5.2.2/.prepared_9a29af10e85e4538a4969bc9817d89f2] Error 1
make[3]: Leaving directory `/usr/local/src/openwrt/trunk/feeds/packages/lang/php5'
make[2]: *** [php5-compile] Error 2
make[2]: Leaving directory `/usr/local/src/openwrt/trunk/package'
make[1]: *** [package/compile] Error 2
make[1]: Leaving directory `/usr/local/src/openwrt/trunk'
make: *** [world] Error 2

you should replace the whole php5 folder with the one provided in my archive. To compile php 5.2.2 no patches are needed anymore, this is why when the build tries to apply patches for the old version it fails.

Anael

still running into trouble when compiling. I replaced all the files (so also libxml)

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr/local/src/openwrt/trunk/staging_dir_mipsel/usr/include/libxml2
checking for xml2-config path... configure: error: xml2-config not found. Please check your libxml2 installation.
make[3]: *** [/usr/local/src/openwrt/trunk/build_mipsel/php-5.2.2/.built] Error 1
make[3]: Leaving directory `/usr/local/src/openwrt/trunk/feeds/packages/lang/php5'
make[2]: *** [php5-compile] Error 2make[2]: Leaving directory `/usr/local/src/openwrt/trunk/package'
make[1]: *** [package/compile] Error 2make[1]: Leaving directory `/usr/local/src/openwrt/trunk'
make: *** [world] Error 2

Just had the same problem. You need the package libxml2-dev (on Debian) or something similar.

I've got libml2-dev installed on my buildmachine but I don't think that that's the problem. I can't find the -dev package in Kamikaze.

installing libxml2-dev on the host-system is not the correct way. now it uses checking for xml2-config path... /usr/bin/xml2-config instead of staging_dir_mips/usr/bin/xml2-config

Ahh, OK. For me it has helped getting the build process a little bit further. Now it stops by not finding libcrypto.  Without the modifications (I need the PDO SQLite Module) the compiling runs normally for me.

Hi,

I will try to fix these problems and post a new version, thanks for reporting the info.

Anael

that would be nice

Will the PDO SQLite module ever be added as an ipkg?

Hello,

I just put a new release of the package sources on my site : http://aorlinsk2.free.fr/openwrt/kamikaze/

- libxml2 has a support for c14n
- sqlite3 is 3.4.2
- php is 5.2.3 and has following configuration options :
[ ] Compile Filter Support       
[*] Compile Reflection Support   
[*] Compile SPL Support           
[*] Compile PDO Dabatase Support 
[*] Compile DOM Support           
and has the following modules (availability changes with configuration options) :
<*> php5......................................... PHP5 Hypertext preprocessor
    PHP Built-in Exetensions Setup  --->                                     
< > php5-cgi............................... PHP5 Hypertext preprocessor (CGI)
< > php5-cli............................... PHP5 Hypertext preprocessor (CLI)
<*> php5-fastcgi....................... PHP5 Hypertext preprocessor (FastCGI)
<M> php5-mod-apc............................................... APC Extension
<M> php5-mod-curl................................................ cURL module
<M> php5-mod-ftp.................................................. FTP module
<*> php5-mod-gd........................................... GD graphics module
<M> php5-mod-gmp.................................................. GMP module
<M> php5-mod-hash................................................ Hash module
<*> php5-mod-iconv.............................................. iConv module
<M> php5-mod-json................................................ JSON module
<M> php5-mod-ldap................................................ LDAP module
<*> php5-mod-mbstring............................ MBString module (BIG one !)
<M> php5-mod-mysql.............................................. MySQL module
<M> php5-mod-openssl.......................................... OpenSSL module
< > php5-mod-pdo-mysql......................... PDO driver for MySQL (broken)
< > php5-mod-pdo-pgsql............................. PDO driver for PostgreSQL
<*> php5-mod-pdo-sqlite3......................... PDO driver for SQLite (3.x)
<M> php5-mod-pgsql......................................... PostgreSQL module
<*> php5-mod-session.......................................... Session module
<*> php5-mod-simplexml...................................... SimpleXML module
<M> php5-mod-sockets.......................................... Sockets module
<*> php5-mod-sqlite...................................... SQLite module (2.x)
<*> php5-mod-xml.................................................. XML module
<M> php5-mod-xmlreader...................................... XMLReader module
<M> php5-mod-xmlwriter...................................... XMLWriter module

all problems relative to libxml2 should be fixed by now.

Ticket 2257 has been opened to integrate those changes in SVN.

Anael

(Last edited by aorlinsk on 21 Aug 2007, 01:31)

Hi,

I've just taken a look at ticket #2257 and it was in a closed state. Doesn't this mean that the changes were committed into trunk? Nevertheless, I can't activate the compilation of XMLReader in 'make menuconfig' of the latest trunk (there isn't such an entry under Languages --> PHP --> php5). How does one do that? smile

à dám

neutron wrote:

Hi,

I've just taken a look at ticket #2257 and it was in a closed state. Doesn't this mean that the changes were committed into trunk? Nevertheless, I can't activate the compilation of XMLReader in 'make menuconfig' of the latest trunk (there isn't such an entry under Languages --> PHP --> php5). How does one do that? smile

� dám

You're right, my patches have never been integrated. If you need the updated libxml2 (with i14n enabled) / php5 (5.2.6) / sqlite (3.5.9) packages for SVN trunk, I can post them on my website.

Anael

aorlinsk wrote:

You're right, my patches have never been integrated. If you need the updated libxml2 (with i14n enabled) / php5 (5.2.6) / sqlite (3.5.9) packages for SVN trunk, I can post them on my website.

Anael

Wow, thanks, I'd appreciate that! smile

Hello,

I've put the packages sources here : http://aorlinsk2.free.fr/openwrt/kamikaze/r11123/

Can you give some feedback about the php5 package ?

When I build the php-fastcgi flavor for x86 plarform (alix 2c3), it segfaults in libuClibc.0.29.so (the core files indicates in _pthread_cleanup_push_defer although the stack seems corrupted), but the original php5 package seem to work (at least php-fcgi does not segfaults at startup).

Hi!

Thanks for the packages! Feedback is to be expected by Friday evening.

Adam

Hi!

There seems to be an anomaly. Compilation works alright, but the php interpreter (started with arbitrary command line parameters) freezes, regardless whether it is php-cli, php-cgi or php-fcgi. None of these commands yields any output at all, but they do it with a CPU usage of 100%. smile Trunk version is 11280.

Adam

neutron wrote:

None of these commands yields any output at all, but they do it with a CPU usage of 100%.

I can confirm that... php-fcgi uses 100% cpu and isn't reachable. It's a pity, though - because SQLite3 would be really useful to me.
Why is it that there are so many modules left out of the compilation in the official trunk?

Everything seems to be related to threading issues of uClibc. I have a php5 compiled on a glibc based  linux box and everything runs smoothly.
I am now trying to port openwrt to libc ...

As a workaround I dropped the threading support during compilation of sqlite3 and it works much better.

To achieve this, here is the diff for my SQLite Makefile :

@@ -46,7 +46,7 @@
   $(call Package/sqlite3/Default)
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+libsqlite3 +libncurses +libreadline +libpthread
+  DEPENDS:=+libsqlite3 +libncurses +libreadline
   TITLE+= (cli)
 endef

@@ -63,6 +63,7 @@
                --enable-shared \
                --enable-static \
                --disable-tcl \
+               --disable-threadsafe \
                , \
                config_BUILD_CC="$(HOSTCC)" \
                config_BUILD_CFLAGS="-O2" \
@@ -70,7 +71,6 @@
                config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
                config_TARGET_READLINE_INC="-I$(STAGING_DIR)/usr/include" \
                config_TARGET_READLINE_LIBS="-L$(STAGING_DIR)/usr/lib -lreadline -lncurses" \
-               LIBS="-lpthread" \
        )
 endef

(Last edited by aorlinsk on 18 Jun 2008, 14:13)

The discussion might have continued from here.