ID:               44801
 User updated by:  twm at twmacinta dot com
 Reported By:      twm at twmacinta dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         CGI related
 Operating System: Red Hat Enterprise Linux ES 3
 PHP Version:      5.2.5
 Assigned To:      fb-req-jani
 New Comment:

I was actually using the "-n" flag from the start, so that moving part
was already eliminated.

Here are my "./configure" and "make install" commands:

----

CONF_OLD_PREFIX=/usr
CONF_PREFIX=/var/tmp2/php5_take2/targ
CONF_SYSCONFDIR=${CONF_PREFIX}/etc
CONF_BINDIR=${CONF_PREFIX}/bin
./configure \
        --prefix=${CONF_PREFIX} \
        --with-config-file-path=${CONF_SYSCONFDIR} \
        --enable-force-cgi-redirect \
        --enable-fastcgi \
        --disable-debug \
        --enable-pic \
        --disable-rpath \
        --enable-inline-optimization \
        --with-bz2 \
        --with-curl \
        --with-dom=${CONF_PREFIX} \
        --with-exec-dir=${CONF_BINDIR} \
        --with-freetype-dir=${CONF_PREFIX} \
        --with-png-dir=${CONF_PREFIX} \
        --with-gd \
        --enable-gd-native-ttf \
        --with-ttf \
        --with-gdbm \
        --with-gettext \
        --with-db4 \
        --with-ncurses \
        --with-gmp \
        --with-iconv \
        --with-jpeg-dir=${CONF_PREFIX} \
        --with-mm \
        --with-openssl \
        --with-png \
        --with-pspell \
        --with-regex=system \
        --with-xml \
        --with-domxml \
        --with-expat-dir=${CONF_PREFIX} \
        --with-zlib \
        --with-layout=GNU \
        --enable-mcal \
        --enable-bcmath \
        --enable-debugger \
        --enable-exif \
        --enable-ftp \
        --enable-magic-quotes \
        --enable-safe-mode \
        --enable-sockets \
        --enable-sysvsem \
        --enable-sysvshm \
        --enable-discard-path \
        --enable-track-vars \
        --enable-trans-sid \
        --enable-yp \
        --enable-wddx \
        --without-oci8 \
        --with-imap=shared \
        --with-mcrypt \
        --with-imap-ssl \
        --with-kerberos=/usr/kerberos \
        --with-ldap=shared \
        --with-mysql=shared,${CONF_PREFIX} \
        --with-pgsql=shared \
        --with-snmp=shared,${CONF_PREFIX} \
        --with-snmp=shared \
        --enable-net-snmp-hack \
        --with-unixODBC=shared,${CONF_OLD_PREFIX} \
        --enable-memory-limit \
        --enable-bcmath \
        --enable-shmop \
        --enable-versioning \
        --enable-calendar \
        --enable-dbx \
        --enable-dio \
        --enable-mbstring \
        --enable-mbstr-enc-trans
make install INSTALL_ROOT=/var/tmp2/php5_take2/targ


Previous Comments:
------------------------------------------------------------------------

[2008-04-24 17:44:49] [EMAIL PROTECTED]

Next obvious question is: How did you build PHP? ie. What configure
line, etc. Also to eliminate every last moving parts: run the script
like this:

# php -n script.php


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

[2008-04-24 17:23:47] twm at twmacinta dot com

Good idea.  I modified my test script as suggested.  Here's the output
on RHEL3 with the CVS snapshot php5.2-20080423123:

----
Before: 'Tim'\''s Test'
After: sh: line 1: /var/tmp2/php5_take2/targ/bin/Tim\s: No such file or
directory
----


In case you're wondering about the path, I set "./configure --prefix"
to "/var/tmp2/php5_take2/targ" so that I could install it there and test
it before overwriting my old PHP 4 installation.  PHP 4 on the same
machine gives the same output as above, except that it's the usual
"/usr/bin/" path.

For comparison, here's the output on my other RHEL3 server which has
the latest, default version of PHP 4.3 from Red Hat:

----
Before: 'Tim'\''s Test'
After: sh: line 1: /usr/bin/'Tim'\''s: No such file or directory
----


I also ran the revised test on Mac OS X 10.5, which has PHP 5.2.5, to
get what is the correct output (i.e., what you got):

----
Before: 'Tim'\''s Test'
After: sh: Tim's Test: command not found
----

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

[2008-04-24 11:09:06] [EMAIL PROTECTED]

]$ php t.php
Before: 'Tim'\''s Test'
After: Tim's Test

So it works fine using latest CVS (for me). 
You're using /bin/echo there, what if you simply do this:

<?php
header("Content-Type: text/plain");
$textEscaped = escapeshellarg("Tim's Test");
print("Before: {$textEscaped}\n");
print("After: ");
passthru($textEscaped);
?>

That would eliminate one "moving part" here..
Just check the resulting error message what it has. :)


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

[2008-04-23 14:13:55] twm at twmacinta dot com

Thank you for the fast reply.  I have tried the latest CVS snapshot
(php5.2-200804231230) and I still get the same incorrect output.  It
sounds like some library in RHEL3 which PHP uses is behaving differently
than on newer platforms.

If it helps, I have another server running the same version of RHEL3
which has the default version of PHP still on it (updated via
'up2date'), rather than one that I compiled.  I know you don't support
PHP 4.3 any longer, I'm just pointing it out in case it helps to know
that this test case has been broken on RHEL3 for awhile, it's not a
problem unique to my compiled version, and the problem didn't just
appear in PHP 5.2.  I do get slightly different output there, but it is
still incorrect.

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

[2008-04-23 00:58:25] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

This looks has been fixed. Works fine for me using 5.2.6-RC4.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/44801

-- 
Edit this bug report at http://bugs.php.net/?id=44801&edit=1

Reply via email to