15

I've been using PHP version 5.2 and now need to upgrade to version 5.3 (Windows/Apache). I have been using 5.2 for awhile now and have customized many things in php.ini and added some extra extensions.

How can I upgrade to version 5.3 without having to reconfigure everything? Or does upgrading require that I customize my PHP installation all over again?

Thanks, Brian

hakre
  • 193,403
  • 52
  • 435
  • 836
Brian
  • 2,107
  • 6
  • 22
  • 40
  • It might help if you specified if you are using IIS or Apache – Macha Oct 22 '09 at 19:25
  • Sorry bout that - I'm using Apache – Brian Oct 22 '09 at 19:30
  • One thing to remember when you upgrade is that Error reporting has added new constants, and if you have errors on, this could cause warnings or notifications to be shown when you upgrade. You'll need to update your error_reporting value in the configuration. http://www.php.net/manual/en/errorfunc.constants.php – Jay Oct 22 '09 at 19:30
  • 1
    Tip: Backup your old PHP directory then copy the new ini suggestion file to php.ini and compare the new ini with your old ini: http://winmerge.org/ - it highlights you the changes and makes it easy to pick your modifications. The PHP.ini has many comments and links inside so you can easily check each changed setting if it's still needed. – hakre Mar 31 '13 at 17:35

3 Answers3

8

If you take a look at Upgrading to PHP 5.3 - an easy way, i think that will solve your problem, but if you're in a Linux machine that you can use apt-get the only thing that you need to do is:

$ sudo apt-get upgrade php php-* mysql-*
$ /etc/init.d/httpd restart

Regards.

Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
  • 2
    Saying that he can use `apt-get` if hes on linux is wrong. That shpould state if he's on a debian-derivate. Far from all distros use `apt-get` – fredrik Mar 31 '13 at 17:39
7

The transition is not necessarily easy, but not hard also. PHP 5.3 brings some changes to the internal Zend API, so some PHP extension need to be upgraded (I had to upgrade xDebug). That means that you need to find the respective DLLs, which may not be that easy, depending on your current setup.

The config file, php.ini, is pretty much the same. You will actually have to take some things out actually (for example extension=php_pdo.dll is not needed anymore).

Just execute php -m from command line and see what errors are thrown. I have just copy-pasted the php.ini file from a 5.2 release and was done configuring 5.3 in a couple of minutes.

I mentioned xDebug a few lines above. If you use it, you should know that the line which activates xDebug is now:

zend_extension = "path\to\PHP 5.3.0\ext\php_xdebug.dll"

instead of:

zend_extension_ts = "path\to\PHP 5.3.0\ext\php_xdebug.dll"
Ionuț G. Stan
  • 176,118
  • 18
  • 189
  • 202
3

The main thing I've run into is a mess of new E_DEPRECATED notices when doing anything from PEAR. Like the other comments, you'll want to adjust your error reporting levels appropriately.

Another thing to notice is that if you're upgrading from a package management system like macports or apt, some of the config layouts have changed and you'll have to adapt there.

Other than that, there aren't a lot of functional differences between 5.2 and 5.3.

Justin
  • 5,029
  • 1
  • 21
  • 21