Well, I'm pretty sure PHP's integers aren't bignums by default. Though I am also pretty sure that PHP provides a arbitrary precision library of some kind.
Basically, the integer types that you are using aren't big enough to compute something as mindbogglingly large as the result of an Ackermann function. The integer is a fixed size in bits, and when you add one to a number like 11111111111111111, you just wrap around to 000000000000000000 again. And this is likely causing problems.
What you want is a bignum / arbitrary precision library. This is a bunch of code that manipulates numbers in main memory, instead of in registers (where size is limited) The advantage of this is that you will never overflow (unless you are trying to store something larger than 2^2^16 or something). The disadvantage of using such a library is that it is a gazillion times slower than regular integers.
See this page for PHP specific stuff.http://php.net/manual/en/language.types.integer.php
or just google "arbitrary precision PHP" or something to that effect.
Ninja-edit: If you are going to be trying to compute the Ackermann function of even bigger values, performance will start to matter. I suggest looking at a more dynamic programming-type algorithm -- i.e. store previously computed values in a table of some sort so you don't compute the same thing over and over again.