How to Fix vBulletin 4.x strict errors with PHP 5.4

I’ve been upgrading a large vbulletin 3.x site to 4.x. I like to do a dry run and make sure everything is working locally before doing the real upgrade in production.

Since I use PHP 5.4 for most things nowadays, it’s the only version I have in my development environment.

I found that vBulletin 4.x and PHP 5.4 don’t play well together initially. I was unable to even run the upgrade tool due to strict errors which caused the headers to be sent early.

vBulletin hard codes error reporting values in a lot of their scripts, here is a one liner to disable strict error reporting.

find . -type f -iname '*.php*' | xargs sed -i 's/E_ALL & ~E_NOTICE/& \& ~E_STRICT/g'

Run this from the document root of your forum.

After this change, I found that vBulletin 4.x ran fine on 5.4 and was able to complete my testing. I recommend that you still run the forum on 5.3 in production though.

2 thoughts on “How to Fix vBulletin 4.x strict errors with PHP 5.4

Leave a Reply

Your email address will not be published. Required fields are marked *