How to compile and expand PHP

藏色散人
Release: 2023-03-09 20:28:01
Original
2785 people have browsed it

How to compile and expand PHP: 1. Download the source code package; 2. Enter the decompressed directory; 3. Dynamically create the extended configure file according to the current PHP version; 4. Execute "php-config"; 5. Compile and install; 6. Introduce extensions; 7. Restart apache.

How to compile and expand PHP

The operating environment of this article: ubuntu 16.04 system, PHP7.1 version, DELL G3 computer

php extension compilation method

php has been compiled under linux, how to add new extensions to php

Through the phpize that comes with php, for example, my phpize is in /usr/local/php/bin/phpize

1. Go to the official website of the software or pecl.php.net to download the source code package

2. Unzip and enter the decompressed directory

3. Dynamically based on the current PHP version Create an extended configure file

/usr/local/php/bin/phpize
Copy after login

4. Use the generated configure file to execute

./configure --with-php-config=/usr/local/php/bin/php-config
Copy after login

5. Compile and install

make && make install
Copy after login

6. Expand the generated .so in php Introduced in .ini (the extension directory can be viewed with phpinfo extension_dir)

extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/扩展.so
Copy after login

7. Restart apache

service httpd restart
Copy after login

Recommended study: "PHP Video Tutorial"

The above is the detailed content of How to compile and expand PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!