PHP 5.4 supports systemd since version 5.4.16 (see http://php.net/ChangeLog-5.php). I've copy-pasted the relevant changes from php-5.5.1-r1.ebuild to php-5.4.17.ebuild and created a patch that works for me. Reproducible: Always
Created attachment 355156 [details, diff] php-5.4.17.ebuild with systemd support
*** This bug has been marked as a duplicate of bug 439918 ***