In the previous article we know how to compile and install a PHP version that we need.
2018/04/25 Compilation and installation of PHP7
It's not over here, we still need to install our extension to complete today's task.
--
Download the extension
Or download from the official website: I downloaded the latest official version 1.1.2 here
--
After the download is successful, we can go in and see
--
cd swoole
Later, you will find that there is no .configure file you need, and the reason is well understood. Since it exists as a PHP extension, it should be compiled by PHP
This is the role of phpize, here I use normal phpize, or you can use the php installation directory /bin/phpize in the installation directory
vagrant@hong:~/swoole$ phpize Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718
If your installation fails here, it should be that autoconfig is not installed
The solution to Cannot find autoconf when phpize compiles and installs the php extension
--
After that is make&make install
--
After the installation is successful, see the last two messages
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/ Installing header files: /usr/local/include/php/
The compilation directory of swoole is declared here
Let's go in and see
vagrant@hong:/usr/local/lib/php/extensions/no-debug-non-zts-20170718$ ls opcache.to opcache.so swoole.so
--
found..so
It means that our compilation and installation are also successful.
--
Then we installed successfully, but it is not possible to use it directly, we must configure the corresponding options in php.ini
[swoole] extension=swoole
--
Try it later!
come on.