I wrote a custom bash shell script to automate the implementation for some of the vB 4.2.x and PHP 5.4 work arounds mentioned in this long thread at http://www.vbulletin.com/forum/forum...march-1st-2012.

  1. This bash shell script can only be run on Linux based servers. It won't work on Windows based servers.
  2. This bash shell script will need server SSH telnet access to be able to run. So only folks with either a VPS or dedicated server would normally have SSH telnet access.
  3. Folks with shared hosting would not have SSH telnet access. Shared hosting folks could either setup a local Linux test server on your home computer using virtualbox or grab a cheap hourly unmanaged VPS server from DigitalOcean.com for US$0.0007/hr - yes use it for 2hrs and only pay US$0.0014. Use it for 24hrs and pay 24 x 0.0007 = US$0.0168. Use it for 1 week and pay 168 x 0.0007 = US$0.1176. You won't need to install anything really, just have a set of vB 4.2.x php files uploaded to the server and point the below script to where those files are. Then once the files are converted, just download the set of files and upload them to where you have your live forums.
  1. BACKUP your vB 4.2.x forum install directory BEFORE running the script !
  2. OR better yet, test the below workaround script on a test copy of your vB 4.2.x forums or a fresh dummy test vB 4.2.x forum installation with PHP 5.4.18 and see if it works as expected. DigitalOcean.com offer hourly charged unmanaged VPS servers (you'd have to setup a full Linux OS, Web server, PHP and MySQL yourself though).
  3. This outlined method is not a vBulletin officially provided nor supported solution. But a personal solution by me only. So please us at your own risk. Although, I have known a few vB 4.2.x forum owners including myelf using this script with PHP 5.4 for over 12+ months without problems that I am aware of.
  4. As this method isn't officially supported by vBulletin, any issues or errors arising from using this work around script generally won't be supported by vBulletin support staff.
  5. Only tested this with PHP 5.4.15+ and higher including PHP 5.4.18 with vB 4.2.0 and 4.2.1. I did also test with vB 4.1.12 series but that was with PHP versions lower than <5.4.15. I would recommend to use vB 4.2.1.
  6. This bash shell script is my personal work and are just an automated implementation of work arounds outlined at http://www.vbulletin.com/forum/forum...march-1st-2012 and not permanent 100% sure fixes to vB 4.2.x. For that please wait for vB 4.2.2 to be released. There is currently no ETA on vB 4.2.2 release but it's left in Paul M's more than capable hands
  7. This work around won't fix PHP 5.4 incompatibilities with 3rd party vB 4.2.x add ons / plugins or any incompatible custom PHP code you may have added to your vB 4.2.x PHP files.
  8. AdminCP - > Maintenance -> Diagnostics -> Suspect File Versions will report that all vB 4.2.x PHP files have 'File does not contain expected contents' status due to the bash shell script changing the PHP display_errors settings from the default. So that is normal.
How to make vBulletin 4.2 forum PHP 5.4 compatible via work arounds.
  1. Save contents of bash shell script in file on server as vbphp54.sh and give executable permissions. In this example I save to custom directory at /root/tools/vbphp54.sh. In SSH telnet type following commands to prepare the file:

    	mkdir /root/tools/
    	cd /root/tools/
    	wget http://vbtechsupport.com/vb4php54/vbphp54.sh
    	chmod +x vbphp54.sh
  2. Edit vbphp54.sh file variable VBINSTALLDIR to point to vB install path. For instance if your vBulletin 4.2.x install is at /home/username/public_html/vb421, you would have it set as follows:

  3. BACKUP your vB 4.2.x forum install directory & files BEFORE hand just as a precautionary measure. In SSH telnet type following commands assuming vB 4.2.x installed at /home/username/public_html/vb421.

    cp -a /home/username/public_html/vb421 /home/username/public_html/vb421_backup
    This will make an identical copy of your vb421 directory named vb421_backup located at /home/username/public_html/vb421_backup which also preserves all directory and file ownership and permissions. This could result in alot of disk space used as you'd essentially double the disk space used by your vb421 directory. If disk space is an issue, you can always download a copy of original files at vb421 before running the below bash shell script.
  4. Then do a dry run to make sure all is okay. By default the vbphp54.sh script will only run in dry run test mode. You'll get a screen full of grep and sed lines which is normal as long as there are no error messages i.e. file not found etc. In SSH telnet type following commands:

    	cd /root/tools/
  5. Then edit vbphp54.sh file and change TESTMODE='n' and run it for real run.

    	cd /root/tools/
    At end of run you should see the following lines:

    	fixing vb/ckeditor.php
    	fixing GD compatibility
    	Disable display_errors in init.php
  6. You should be all set to go now and vBulletin 4.2.x will work with PHP 5.4 for now.
I did fresh install and test with vB 4.2.1 with CentOS 6.4, Nginx 1.5.3 and PHP 5.4.18 on local computer via Virtualbox virtual server and all works fine. The only initial error you'd get running install.php is the prompt that says unexpected content in php files. That is normal and just select ignore and continue to proceed with installation.

For comments and questions please use the thread at http://www.vbulletin.com/forum/forum...d-shell-script