eZ Publish 4.0 uses Website Interface 1.3 (PHP 5). eZ Publish 3.9 uses Website Interface 1.2 (PHP 4). Those when you upgrading eZ Publish you need to upgrade ezwebin as well.
Packages for eZ Publish 4.0 are available here: http://packages.ez.no/ezpublish/4.0/4.0.0/