PHP extensions require a slightly different installation method to a traditional PHP-based library or framework. You can either download a binary package for the system of your choice or build it from the sources.
On a Linux/Solaris system you can easily compile and install the extension from the source code:
Prerequisite packages are:
- PHP >= 5.4 development resources
- GCC compiler (Linux/Solaris)
- Git (if not already installed in your system - unless you download the package from GitHub and upload it on your server via FTP/SFTP)
- Zephir >= 0.9.4a-dev
Specific packages for common platforms:
# Ubuntu sudo apt-get install php5-dev gcc make autoconf # Suse sudo yast -i php5-devel gcc make autoconf # CentOS/RedHat/Fedora sudo yum install php-devel gcc make autoconf # Solaris pkg install php-56 gcc-48 make autoconf
Of course, you need to install PHP development headers and tools appropriate for your current PHP version.
Creating the extension:
git clone --depth=1 https://github.com/phalcongelist/beanspeak.git cd beanspeak zephir build # Or, for PHP 7 use zephir build --backend=ZendEngine3
Important: After that, the compiled extension will be placed in the appropriate directory. If the automatic installer failed to do this try moving extension manually.# Use right path to the PHP extensions dir here sudo cp ext/modules/beanspeak.so $(php-config --extension-dir)
Add extension to your PHP configuration:
# Suse: Add a file called beanspeak.ini in /etc/php5/conf.d/ with this content: extension=beanspeak.so # CentOS/RedHat/Fedora: Add a file called beanspeak.ini in /etc/php.d/ with this content: extension=beanspeak.so # Ubuntu/Debian with apache2: Add a file called 50-beanspeak.ini in /etc/php5/apache2/conf.d/ with this content: extension=beanspeak.so # Ubuntu/Debian with php5-fpm: Add a file called 50-beanspeak.ini in /etc/php5/fpm/conf.d/ with this content: extension=beanspeak.so # Ubuntu/Debian with php5-cli: Add a file called 50-beanspeak.ini in /etc/php5/cli/conf.d/ with this content: extension=beanspeak.so
Restart the webserver.