Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Phalcon 2 on Mac with MacPorts and PHP 5.6

Hello,

I have problems with compiling Phalcon 2 on my Mac machine. Yesterday I've installed apache2, php56 and the php56-mysql with MacPorts and all that works properly. What are the next steps to compile Phalcon 2 with Zephir? I've adjusted the $PATH variable to use the new PHP version installed by MacPorts. I've installed APCu and mcrypt, too. But zephir generate reports: the functions are not available at compile time. What I'm doing wrong? Does somebody know a step by step tutorial?



81.7k
Accepted
answer

MacPorts installs PHP executables with the suffix 54, 55, 56 and so on:

/opt/local/bin/php56
/opt/local/bin/phpize56
/opt/local/bin/php-config56

And a standard OSX installation bundles and old version of PHP that is available in /usr/bin:

/usr/bin/php
/usr/bin/phpize
/usr/bin/php-config

So you can rename the PHP in /usr/bin and symlink the ones in /opt/local to the standard names:

sudo ln -s /opt/local/bin/php56 /opt/local/bin/php
sudo ln -s /opt/local/bin/phpize56 /opt/local/bin/phpize
sudo ln -s /opt/local/bin/php-config56 /opt/local/bin/php-config

To check this has worked just check the php version:

$ php -v
PHP 5.6.2 (cli) (built: Oct 17 2014 15:28:12) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies


4.0k

Thanks @Phalcon, now it works! :)