I had to learn the hard way. On my Mac I have MAMP installed. MAMP great piece of software that installs Apache, MySQL and PHP. It makes everything easy. As of this post, the PHP included in MAMP is PHP Version 5.2.6. That is pretty acceptable – it should work with Zend Framework.
I wanted to use Zend Framework for a small project. So I downloaded the latest copy of Zend Framework and extracted it inside my htdocs directory. I used Zend_Tool to create a project, so I did everything by the book to make it work — But it didn’t. I have been trying since yesterday. And today, I found out that MacOS ships with an old copy of PHP.
I overlooked the PHP Version when I ran this
php -i | more
in the terminal. The PHP CLI was using PHP Version 4.4.9. Big FAIL.
The whole time I was doing “zf.sh” on the console, it was using the PHP that was shipped with the OS (PHP Version => 4.4.9).
BUT I did not know that MacOSX is shipped with PHP — the PHP shipped with the OS is broken and old — PHP Version => 4.4.9.