1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Horde on freebsd bug, no iconv support

Discussion in 'Plesk for Linux - 8.x and Older' started by laurentf, Jun 22, 2005.

  1. laurentf

    laurentf Guest


    I have a problem with Horde on Plesk 7.5.3 with FreeBSD 5.3 ( seems to be Plesk/FreeBSD specific) :

    with a french localized browser (IE or Firefox, whatever) all accents a replaced by weirds characters.

    At first sight, the problem is that the page is sent in ISO-8859-1, but the browser expects UTF-8 ( for instance, in Firefox, changing the character encoding from UTF-8 to ISO-8859-1 solves the problem temporary, for only one page)

    By looking at
    http://webmail.domain.tld/horde/test.php, i can see, under "PHP Module Capabilities" section :

    Iconv Support: No
    in phpinfo() , the configure section looks terrible :
    './configure' '--enable-versioning' 
    '--enable-memory-limit' '--with-layout=GNU' 
    '--with-zlib-dir=/usr' '--disable-all' 
     '--enable-static' '--enable-mbstring' 
    '--enable-mbregex' '--with-regex=php' 
    '--with-pear' '--enable-ctype' 
     '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' 
    '--with-pcre-regex=yes' '--enable-posix' 
    '--enable-tokenizer' '--with-expat-dir=/usr/home/builder/tmp_serge/psa_PLESK_7_5_3/lib/dist'
     '--enable-xml' '--enable-xslt' 
     '--prefix=/usr/local/psa/apache' 'i386-portbld-freebsd5.3'
    the /usr/home/builder/tmp_serge/psa_PLESK_7_5_3/lib/dist seems to be big plesk bug !!! :mad:

    moreover, there are *TWO* --with-iconv-dir ( the first in /usr/local, the second in the path above ), but NO --with-iconv (which activate iconv support)

    ( same thing on a test box with a fresh install, so I'm sure it's the 'stock' php bundled with Plesk on FreeBSD ... )

    To verify this, I tried to recompile php by hand (which is not easy, because my system don't have /usr/home/builder/tmp_serge ... :D )
    After a few try, I managed to recompile an unperfect PHP ( I didn't solved all the required dependancies ...) with iconv support --> Horde works perfectly with french accents !

    So, after this long intro, here's my question :

    What is the neatest way to recover iconv support in php ? (without waiting for an hypothetical new version of Plesk which solves the problem ...)

    thanks !
  2. laurentf

    laurentf Guest

    I answer to myself :

    Here's my recipe to recompile php on FreBSD 5.3 with plesk 7.5.3 :

    - use a fresh /usr/ports tree (updated with cvsup for instance)

    - install the following packages ( with cd /usr/ports/<section>/<package> ; make ; make install )

    * devel/bison
    * ftp/curl
    * converters/libiconv
    * databases/libiodbc ( edit the Makefile and add 'WITHOUT_GUI= yes ' at the beginning if you don't want to compile xorg and gtk ... )
    * print/freetype2
    * graphics/jpeg
    * graphics/png
    * textproc/libxslt
    * textproc/expat2
    * textproc/libxml2
    * textproc/sablotron ( DON'T check ICONV_TYPECAST !)
    * mail/imap_uw
    * security/mhash

    - download php-4.3.11 source from www.php.net, and untar the archive somewhere

    - configure php like this :

    ./configure \
    --enable-versioning \
    --enable-memory-limit \
    --with-layout=GNU \
    --with-zlib-dir=/usr \
    --disable-all \
    --prefix=/usr/local/psa/apache \
    --with-config-file-path=/usr/local/psa/apache/conf \
    --enable-track-vars \
    --with-iodbc \
    --enable-static \
    --enable-mbstring \
    --enable-mbregex \
    --with-regex=php \
    --with-pear \
    --enable-ctype \
    --with-curl \
    --with-dom \
    --enable-ftp \
    --with-gd \
    --enable-gd-native-ttf \
    --enable-gd-jis-conv \
    --with-freetype-dir=/usr/local \
    --with-jpeg-dir=/usr/local \
    --with-png-dir=/usr/local \
    --without-tiff \
    --with-gettext \
    --with-iconv \
    --with-iconv-dir=/usr/local \
    --with-mhash \
    --with-mysql=/usr/local/psa/mysql \
    --with-openssl \
    --enable-overload \
    --with-pcre-regex=yes \
    --enable-posix \
    --with-pgsql=/usr/local/psa/postgresql \
    --enable-session \
    --enable-sockets \
    --enable-tokenizer \
    --with-expat-dir=/usr/local \
    --enable-xml \
    --enable-xslt \
    --with-xslt-sablot \
    --with-zlib=yes \
    --with-apxs2=/usr/local/psa/apache/bin/apxs \
    --with-imap= \
    --with-imap-ssl \
    --prefix=/usr/local/psa/apache i386-portbld-freebsd5.3 > configure.log
    - check configure.log to see if it's OK for you

    - make

    - do a backup of /usr/local/psa/apache, just in case ...

    - make install , stop and start apache via th plesk control panel

    - it works !!!! :p

    --> PHP should behave exactly as the plesk version, but with iconv support ( all the accents work in Horde ...). It only lacks the javascript support with sablotron, not a big issue for me ( but if someone knows how to compile it, I'm interested)

    --> of course, don't trust me and don't do this on your production environnement ! What's working for me maybe won't work for you !

    --> if someone from SW-SOFT read this thread : it would be kind to do something like this in the next patchset ...
  3. shubin

    shubin Guest

    works great!

    Works very well, great work!
    i have only one note:
    restart apache from command-line using command
    #/usr/local/psa/rc.d/httpd restart
    it's much safer

    yes. and the best solution is to use applications from ports:)
  4. Laurent Bauer

    Laurent Bauer Guest


    I have the same problem with Plesk 7.5.4 under Fedora Core 2, but iconv support *enabled*.
    I also get weird characters instead of accents (French language). Is it a known bug or a config problem ?
    I upgraded from 7.1.4 a while ago, and (from my clients' point of view) this is when the problem occurred.

    Thanks for helping.