php >4.3.2 and mbstring

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Does anyone have a working install of PHP >4.2.3 on linux?

I'm about to wear out my box recompiling this thing over and over. I've tried 4.2.3, 4.3.0, and from the CVS, php4-STABLE-200212312230. They all have the same problem, POST variables get messed up. This is very bad. phpMyAdmin doesn't work, not a biggy, but my local install of vB corrupted some tables (I repaired them, but vB keeps corrupting them).

References:
Post variable names stripped of first 4 characters
http://bugs.php.net/bug.php?id=19404

mbstring extension truncates variables
http://bugs.php.net/bug.php?id=19347

(PHP-DEV mailing list, people arguing about enabling mbstring by default for 4.3.0)
http://www.zend.com/lists/php-dev/200211/thrd13.html

my config params...

[root@host php-4.3.0]./configure \
> --prefix=/usr/local/php-4.3.0 \
> --with-mysql=/usr/local/mysql \
> --with-apxs=/usr/local/apache/bin/apxs \
> --with-zlib \
> --with-gd \
> --disable-mbstr-enc-trans \
> --disable-mbstring

Still doesn't work. Looks like I'll have to revert to 4.2.2, grr.

Mark Hensler
If there is no answer on Google, then there is no question.

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

Not working??
I had just downloaded it and gunzipped it when I read this
Let me know what comes of this... until then I'll stay with 4.2.2

He has: 1,016 posts

Joined: May 2002

We are running PHP 4.2.3 on our servers and I haven't noticed any problems. Try removing the file "config.cache" from the PHP install directory before you ./configure... If you want to know our congigure params, just let me know.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I'd like to see your params, plz.

I did a `rm -f config.cache` and `make clean` before each time. I'm going to go bald in a few more hours. Argh!

Mark Hensler
If there is no answer on Google, then there is no question.

He has: 1,016 posts

Joined: May 2002

Here it is...

Quote: ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --enable-bcmath --enable-calendar --with-curl --with-swf=/usr/local/flash --enable-ftp --with-gd=../gd-2.0.4 --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --with-imap --with-kerberos --with-mcrypt --with-ming=../ming-0.2a --enable-magic-quotes --with-mysql --with-pear --enable-sockets --enable-track-vars --enable-versioning --with-zlib

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I'm missing something big... after compiling stuff all day, and getting no where, I've managed to botch things up good.

I reverted to PHP 4.2.2, and deleted the PHP-4.3.0 directory. Stopped and started apache (apachectl), and phpinfo() is still showing PHP 4.3.0. Even though there is no install on the system. On top of that, mbstring is enabled (when I had tried my darndest to turn it off).

I've pretty much decided it's time to upgrade my system with a new install. I've been running Mandrake 8.0 since it came out. Mandrake 9 has been out for a while. I'll just find some time in the next few weeks to do a backup, format, and fresh install.

Oh, BTW, when compiling PHP 4.2.2, I got an error about no more HD space. I did a `df -a` and I was completely out of room on the /usr mount (2.9GB). That's when I deleted the installs for PHP 4.3.0 and PHP 4.2.3. /var was givin 11GB, and I've only used 206MB. So next install, I'll plan a little better. Wink (and maybe get a larger drive)

Thanks for the params. I'm still taking notes for my next attempt. Smiling

Mark Hensler
If there is no answer on Google, then there is no question.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

ARGH!!!

I formatted and re-installed the opperating system (with a much larger /usr), and just spent the day installing mysql 3.23.55, Apache 2.0.44, and PHP 4.3.0. But... PHP still acts spazzy!

I even tried applying the 'patch' described here:
http://news.php.net/article.php?group=php.bugs&article=19983
But it didn't help at all. I made a backup of mbstring.c prior to editing. I'll probably revert the file tomorrow because my head is swollen the size of Texas.

If anyone has any notes, I'd really appreciate this. I'm fairly new to compiling this stuff, so I take notes whenever I'm working with it. I just installed the OS last night, so this was done on a fresh box. Here are my notes from today: (phpinfo)

Installing Mandrake 9.0
    with Apache 2, PHP 4.3.0, mySQL 3.23

================================================================================

Notes:

    All of the following was performed while logged in as root.

--------------------------------------------------------------------------------

Download:

    httpd-2.0.44.tar.gz                     - Apache 2.0.44
    mysql-3.23.55-pc-linux-i686.tar.gz      - mySQL 3.23.55
    php-4.3.0.tar.bz2                       - PHP 4.3.0
    zlib-1.1.4.tar.bz2                      - Zlib 1.1.4

================================================================================

Compile & Install mySQL 3.23.55:
   
    # tar -xzf mysql-3.23.55-pc-linux-i686.tar.gz
    # mv mysql-3.23.55-pc-linux-i686 /usr/local/
    # ln -s mysql-3.23.55-pc-linux-i686/ mysql
    # cd mysql-3.23.55-pc-linux-i686/
    # ./scripts/mysql_install_db
    # groupadd mysql
    # useradd -g mysql mysql
    # chown -R root .
    # chown -R mysql data
    # chgrp -R mysql .
    # cp ./support_files/mysql.server /etc/init.d
    # chkconfig --add mysql.server

--------------------------------------------------------------------------------

Compile & Install Apache 2.0.44:
   
    I first tried moving the httpd-2.0.44 directory to /usr/local/ prior to
    compiling, but this errored when doing the `make install`.
   
    Performing the compile in /home/server_stuff/apache/httpd-2.0.44 seems to
    work best.

    # tar -xzf httpd-2.0.44.tar.gz
    # cd httpd-2.0.44
    # mkdir /usr/local/httpd-2.0.44
    # ln -s /usr/local/httpd-2.0.44/ /usr/local/apache2
    # ./configure --prefix=/usr/local/httpd-2.0.44 \
    --enable-so \
    --enable-info \
    --enable-rewrite \
    --enable-headers \
    --enable-speling
    # make
    # make install
   
    Edit /usr/local/httpd-2.0.44/conf/httpd.conf
   
    # cp bin/apachectl /usr/local/sbin/
    # apachectl start

--------------------------------------------------------------------------------

Compile & Install Zlib 1.1.4:

    # tar -xjf zlib-1.1.4.tar.bz2
    # cd zlib-1.1.4
    # mkdir /usr/local/zlib-1.1.4
    # ./configure --prefix=/usr/local/zlib-1.1.4
    # make
    # make install

--------------------------------------------------------------------------------

Compile & Install PHP 4.3.0:
   
    Learning from the Apache2 install above, I'm leaving the php-4.3.0 directory
    in the /home/server_stuff/php/ directory.
   
    # tar -xjf php-4.3.0.tar.bz2
    # cd php-4.3.0
    # mkdir /usr/local/php-4.3.0
    # ln -s /usr/local/php-4.3.0/ usr/local/php
    # ./configure --prefix=/usr/local/php-4.3.0 \
    --with-mysql=/usr/local/mysql \
    --with-apxs2=/usr/local/apache2/bin/apxs \
    --enable-ftp \
    --enable-track-vars \
    --enable-trans-sid \
    --with-gd \
    --with-zlib-dir=/usr/local/zlib
    # make
    # make install
    # cp php.ini-dist lib/php.ini
   
    Optionally, modify php.ini to enable register_globals.
   
    Edit httpd.conf to add the following lines:
        LoadModule php4_module modules/libphp4.so
        AddType application/x-httpd-php .php
   
    Restart apache.

================================================================================

After Thoughts:
   
    I was unable to perform a compile of mysql.  I now beleive that this is
    because I moved the src into /usr/local/mysql prior to compiling.  My hunch
    is that I could have compiled successfully had I compiled from
    /home/server_stuff/mysql.
   
================================================================================
                             -= End Transmission =-                            
'

Mark Hensler
If there is no answer on Google, then there is no question.

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

A couple of things that I noticed. I usually prefer downloading and compiling the source rather than the binary. Also make sure that you downloaded the correct version of php, a tar.gz version rather than a bz2 version.

By default, php 4.3 turns off Register Globals in php.ini. Make sure that it is turned on.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

I did compile the source for PHP. Is the gzip version any different than the bzip2 version? I just thought that the bz2 had better compression (for a smaller download).

I tried with register_globals both on and off. I also played with the magic_quotes_gpc.

Mark Hensler
If there is no answer on Google, then there is no question.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Well, now I'm doubting myself. This whole thing has me confused and chasing in circles.

phpMyAdmin 2.3.0, 2.3.2, and 2.4.0 don't work. All post data funkified.

However, I just installed vB on the box, and it seems to be working fine (post data intact).

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.