Home  >  Article  >  php教程  >  Detailed steps for installing openssl, swoole and other extensions under Linux

Detailed steps for installing openssl, swoole and other extensions under Linux

高洛峰
高洛峰Original
2016-12-23 18:02:221738browse

OpenSSL is an open source SSL technology. Since I need to use php related functions and obtain https files, I must install this thing. Let me introduce you to the detailed steps for installing openssl, swoole and other extensions under Linux. Let’s take a look!

Compile and install

First let’s look at the compiled and installed PHP. If you need to install a new extension, here is an example of installing the openssl extension

1. Find the PHP source code directory. Our source code here is located at /opt/download/php -5.5.30, if not found, check the current php version, change php-5.5.30 to the specific version and re-download it through wget http://cn2.php.net/distributions/php-5.5.30.tar.gz That’s it

2. Switch to the source code directory and find the corresponding extension package cd /opt/download/php-5.5.30/ext/openssl

3. Find the directory where phpize is located (can be found through whereis), and then execute /usr /local/bin/phpize

4. Some may report an error after execution, indicating that config.m4 cannot be found. The current directory config0.m4 is config.m4, just rename it directly (mv config0.m4 config.m4)

5. ./configure --with-openssl --with-php-config= /usr/local/bin/php-config

6. make && make install, after successful execution, an openssl.so file will be generated

7. Search in the php.ini file: extension_dir =, add extension=openssl.so in the php.ini file

8. Restart apache and check whether the extension is successfully installed through php -m or phpinfo

yum installation

Passed For PHP installed with yum, it is much easier to install extensions

yum install php-openssl

To install other extensions such as swoole extension, you can do the same thing

The above is the editor’s introduction to installing openssl, swoole and other extensions under Linux The detailed steps, I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank you all for your support of the PHP Chinese website!

For more detailed steps on installing openssl, swoole and other extensions under Linux, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn