php7 compilation and installation error
Error and solution
PHP, as a space and server programming language, has been an important choice for website developers in recent years. Most hosts have pre-installed the PHP environment, but for server administrators, they also You may face some situations where you need to compile and install PHP yourself. However, during this process, due to various reasons, the compilation and installation of PHP is not always smooth, which requires us to troubleshoot and solve the problem. This article will teach you how to solve a common PHP compilation and installation error.
Problem description:
When installing PHP7.x, running the make command, the following error will appear during compilation:
configure: error: cannot find OpenSSL's libraries
make: * [ext/openssl/openssl.lo] Error 1
Cause analysis:
This error message means that OpenSSL is missing during the PHP configuration process library file, so there was a problem during compilation.
OpenSSL is an open source Secure Sockets Layer encryption technology responsible for encrypting Internet communications. The root cause of this problem is that the OpenSSL library is not installed or is installed but not configured correctly.
Solution:
1. Download OpenSSL
Download the library corresponding to the PHP version you installed from the official website of OpenSSL (http://www.openssl. org/source/). We need to download the source code of OpenSSL so that we can configure it accordingly when compiling.
2. Install OpenSSL
Compile and install the source code of the OpenSSL library (the following commands are the installation process for CentOS systems, please check for other systems by yourself):
cd /usr /local/src
wget https://www.openssl.org/source/openssl-1.0.2t.tar.gz
tar zxvf openssl-1.0.2t.tar.gz
cd openssl-1.0.2t
./config --prefix=/usr/local/openssl --shared
make && make install
Note : The above openssl path must be the same as the path used later when compiling php.
3. Configure OpenSSL
In the PHP source code folder, find the configure file (located at root@localhost:/usr/local/src/php-7.0.13$) and add The following command:
--with-openssl-dir=/usr/local/openssl
Before modification:
./configure
After modification:
./configure --with-openssl-dir=/usr/local/openssl
4. Compile and install PHP
After configuring OpenSSL, return to the php source Code directory, execute the following command to compile and install PHP:
cd /usr/local/src/php-7.0.13
./configure --prefix=/usr/local/ php7 --with-config-file-path=/usr/local/php7/etc --enable-fpm -with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv --with-freetype- dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --with- fpm-user=www --with-fpm-group=www --with-pcre-regex --with-pcre-dir --enable-mbstring --with-mcrypt --with-gd --enable-gd-native -ttf --with-openssl-dir=/usr/local/openssl --with-mhash
make && make install
5. Check the operation of PHP
After the installation is complete, check whether the PHP environment is installed successfully.
/usr/local/php7/bin/php -v
If the PHP version number information appears, it means that PHP7 has been successfully installed:
PHP 7.0.13 (cli) (built: Dec 8 2016 09:45:58) ( NTS )
Copyright © 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright © 1998-2016 Zend Technologies
Conclusion:
Through the above process, we can successfully install PHP and solve the compilation and installation errors caused by missing OpenSSL library files. Of course, the commands required for compilation may be slightly different for different systems, but this is also one of the solutions to common compilation errors caused by missing OpenSSL. I hope it will be helpful to beginners and readers in need.
The above is the detailed content of php7 compilation and installation error. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

PHP 8's JIT compilation enhances performance by compiling frequently executed code into machine code, benefiting applications with heavy computations and reducing execution times.

The article discusses symmetric and asymmetric encryption in PHP, comparing their suitability, performance, and security differences. Symmetric encryption is faster and suited for bulk data, while asymmetric is used for secure key exchange.

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

The article discusses implementing robust authentication and authorization in PHP to prevent unauthorized access, detailing best practices and recommending security-enhancing tools.

The article discusses strategies to prevent CSRF attacks in PHP, including using CSRF tokens, Same-Site cookies, and proper session management.

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand
