PHP 5.2.5 woes

Support/Development for PHP
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Updated Patch

Unread post by breun »

jas8522 wrote:We updated from 5.1 to 5.2.5 directly so we don't have the 5.2.4 RPM's ... anyone know of a simple way to roll back to 5.2.4? Must I rpm -e all php RPM's then download all of the 5.2.4 ones individually and install them?
No need to remove PHP, you can use rpm -Uvh --oldpackage to 'upgrade' to older packages. There are no PHP <5.2.5 packages in the atomic channel anymore though.

You can get the spec files for older versions at http://3es.atomicrocketturtle.com/packages/php/ and build the rpms yourself though.
Lemonbit Internet Dedicated Server Management
jas8522
Forum User
Forum User
Posts: 52
Joined: Mon Jan 09, 2006 4:02 pm

Unread post by jas8522 »

Scott... any chance of getting that new patch included in an update?

http://bugs.php.net/bug.php?id=43677&thanks=6

Jordan
inc_ubus
New Forum User
New Forum User
Posts: 1
Joined: Tue Feb 05, 2008 2:16 pm

Use PHP4 for Horde along side PHP 5.2.5 for everything else.

Unread post by inc_ubus »

I'm kind of tethered to Modernbill right now so upgrading to Plesk8 introduces a whole host of issues. The only issue I have with php5.2.5 is Horde. So after many different "fixes" that didn't completely work this is the one that worked best.

Download and uncompress source:

Code: Select all

cd /usr/src/
wget http://us2.php.net/distributions/php-4.4.7.tar.gz
tar xvzf php-4.4.7.tar.gz
cd  php-4.4.7/
Now configure and resolve any dependencies:

Code: Select all

./configure --prefix=/usr/local/php4 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --with-libdir=lib --with-config-file-path=/usr/local/php4/lib --with-pic --disable-rpath --with-exec-dir=/usr/bin --with-png-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-iconv --with-jpeg-dir=/usr --with-png --with-zlib --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --enable-calendar --with-libxml-dir=/usr --with-xml --enable-force-cgi-redirect --enable-pcntl --enable-mbstring --enable-mbregex --with-ncurses --with-gd --enable-bcmath --with-xmlrpc --with-mysql --with-mysqli --enable-dom --with-xsl --enable-fastcgi --program-suffix=4 --with-expat-dir=/usr --with-ldap=shared --with-imap --with-imap-ssl=/usr/include/openssl --with-kerberos
Compile and install php4:

Code: Select all

make
make install
Check if the modules are installed properly with php4:

Code: Select all

/usr/local/php4/bin/php -m
If not check the following binaries

Code: Select all

 ./sapi/cgi/php -m
Copy them over if needed:

Code: Select all

cp -rf ./sapi/cgi/php /usr/local/php4/bin/
Setup directories for apache:

Code: Select all

mkdir -pv /etc/httpd/cgi-sys/
cp -rf ./sapi/cgi/php /etc/httpd/cgi-sys/
cp -rf php.ini-recommended  /usr/local/php4/lib/php.ini
Create this file /etc/httpd/conf.d/zz050a_horde_php_workaround.conf and insert the following:

Code: Select all

<DirectoryMatch /usr/share/psa-horde>
        AddHandler application/x-httpd-php4 .php
        php_value include_path "/usr/share/psa-horde/lib:/usr/share/psa-horde:/usr/share/psa-horde/pear:."
</DirectoryMatch>
Modify Horde to work with CGI version of PHP:

Code: Select all

vi /etc/psa-horde/imp/servers.php
Go to line 206 and edit to look like this:

Code: Select all

// get hostname from http URL (patch for Plesk)
#$headers = getallheaders();
$ServerName = preg_replace('/^webmail\./', '', preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']));
Now the installation is finished, restart Apache and test Horde.

http://webmail.domain.com/test.php

It should list your version of php as 4. Now test your webmail and you should be able to log in rather then see a white page.
Highland
Forum Regular
Forum Regular
Posts: 674
Joined: Mon Apr 10, 2006 12:55 pm

Unread post by Highland »

There's an easier fix still.

1. Make certain php-pear is installed

Code: Select all

#rpm -q php-pear
2. Edit /etc/php.ini and change the following line

Code: Select all

include_path = ".:"
to

Code: Select all

include_path = ".:/usr/share/pear"
3. Restart Apache

Code: Select all

#apachectl graceful
Not the best of solutions but it works. One possible caveat: I have open_basedir set to none on my main email domains so I do not know if that would interfere with this. But I haven't had to hack any Apache files to make Horde work again under 5.2.5-4

As a side note someone from php.net responded to the bug list today so maybe there's hope of an offical build soon...
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

I havent run into any issues with php_admin_value open_basedir, so you're probably OK there.
jas8522
Forum User
Forum User
Posts: 52
Joined: Mon Jan 09, 2006 4:02 pm

Unread post by jas8522 »

This problem affects those who are attempting to use register_globals 1 when it is disabled globally - it switches between on and off seemingly random at page loads.

It also affects the use of include_dir in htaccess files. Since we have display_errors disabled globally as these sites are all live, and the include_dir value switches back and forth between custom values and the global vlaue, pages randomly show blank white when the page is loaded

This is really not good, as we have a number of customers with specific include directories specified that continue to flash between their site and a blank white page!

Is there any chance of getting that new patch applied? The PHP dev team appears to not care too much that this problem exists based on the comments in that ticket.

Thanks,

Jordan
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Its on my list, but to be honest I have so much other work ahead of it right now I don't see getting to it any time soon. The last time I did it, I had a near catastrophe on my hands. :P This is the kind of thing that needs a lot of testing.
rspurlock
Forum User
Forum User
Posts: 9
Joined: Sat May 21, 2005 4:05 pm
Location: TN

can we just get the old rpms?

Unread post by rspurlock »

Scott,

From what I gather, the easiest fix for this is to go back to 5.2.4...So can you just put up the old RPMs for us to grab? I tend to break things when I don't use your RPMs. If you can't put them back up, can anyone share their 5.2.4 RPMs so I can get rid of this daily headache?

TIA,
Rob
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

izooxman
New Forum User
New Forum User
Posts: 1
Joined: Mon Feb 18, 2008 6:39 pm

How I successfully rolledback php

Unread post by izooxman »

Thank you all for posting and helping. I was baffled and was able to successfully rollback my php version to one prior to php 5.2.5 which solves the php_admin_value issues altogether. This is what I did:

Code: Select all

# cd /var/cache/yum/atomic
# rpm -Uvh --oldpackage php*[package version prior to 5.2.5 (must be in /var/cache/yum/atomic)]*
# /etc/init.d/httpd stop
# /etc/init.d/httpd start

* Notes: My plesk software version is 8.3.0, in case anyone wants to know.
** Notes: I had php-5.2.3 on my machine from previous upgrades.

After this all broken sites as well as horde webmail worked like a charm.

_____________________________________________________________

Matthew Scalf
izoox - a soldier in the fight for a pain free web.
rspurlock
Forum User
Forum User
Posts: 9
Joined: Sat May 21, 2005 4:05 pm
Location: TN

Unread post by rspurlock »

Hi Matthew,

Would you be willing to make available the previous php versions you had already? I'm looking for an older version I can roll back to. The concensus is to create them from source but I am certain it will lead to disaster. PM me if you are willing to put them up so I can grab them.

TIA,
Rob
jas8522
Forum User
Forum User
Posts: 52
Joined: Mon Jan 09, 2006 4:02 pm

Building from source

Unread post by jas8522 »

Building from his source RPM's was actually quite easy.. just download them, and run rpmbuild --rebuild <filename>

Then once they are built go to the build dir and run rpm -Uvh <filename> --force

You can obviously replace filename with wildcards like *.art.rpm (or however they end). I'm pretty sure that was all I had to do...
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

heres another shortcut, use yum-builddep to automatically install all the dependencies you need to build it.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

If you don't have yum-builddep install the yum-utils package.
Lemonbit Internet Dedicated Server Management
andrewkhunn
Forum User
Forum User
Posts: 6
Joined: Fri Jan 18, 2008 3:21 pm

Unread post by andrewkhunn »

Semi-relevant to the direction of this topic (although I apologize that it's a bit off the mark): I have a patch for PHP (http://php-fpm.anight.org/) that I would like to apply to the latest SRPM (php-5.2.5-4.art.src.rpm). I have downloaded the SRPM and php.spec, the patch, and used yum-builddep on the SRPM.

Could anyone walk me through what I might need to do to actually rebuild the package with the patch applied?
Post Reply