nginx - 关于php模块的动态编译
写法1: --enable-zip
写法2:--enable-zip=shared
写法1是不是指要静态编译?
写法2是不是指要动态编译?会生成.so文件吗? 如果是的话,它与编译完PHP后,使用phpize命令进模块的增加有什么不同?
回复内容:
写法1: --enable-zip
写法2:--enable-zip=shared
写法1是不是指要静态编译?
写法2是不是指要动态编译?会生成.so文件吗? 如果是的话,它与编译完PHP后,使用phpize命令进模块的增加有什么不同?
原理参考:http://www.walu.cc/phpbook/5.2.md
写法1是静态编译,不会生产so文件;写法2是动态编译,会生产so文件。写法2是编译安装PHP时一起做的,实质结果和phpize仍然是一样的,同样要修改ini文件显示的配置扩展so。但是,写法2有几个相关的问题:
- 官方PHP发行源代码中不一定包含你需要的扩展源代码,因此你不能直接enable或with,如果要这样做则需要删除原理的configure文件并拷贝扩展源代码到ext目录,然后
./buildconf --force
重新生成configure文件 - 否则,如果官方PHP发行源代码中没包含你需要的扩展源代码你也没要一定要静态编译的方式安装,则有2个选择:一是如果支持pecl命令安装,则直接用pecl命令安装;如果扩展不支持pecl安装,才自己使用phpize何php-config命令编译安装
关于两种安装方式的区别,前面提到的网站中有相关的说明,主要是静态编译是直接将扩展编译到PHP主程序中了,其扩展调用的步骤不动态编译方式要简单,有利于提高性能。但是,大部分时候,这点性能应该是可以忽略的了

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

AI Hentai Generator
Generate AI Hentai for free.

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



PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

How to confirm whether Nginx is started: 1. Use the command line: systemctl status nginx (Linux/Unix), netstat -ano | findstr 80 (Windows); 2. Check whether port 80 is open; 3. Check the Nginx startup message in the system log; 4. Use third-party tools, such as Nagios, Zabbix, and Icinga.

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

Deploying a ZooKeeper cluster on a CentOS system requires the following steps: The environment is ready to install the Java runtime environment: Use the following command to install the Java 8 development kit: sudoyumininstalljava-1.8.0-openjdk-devel Download ZooKeeper: Download the version for CentOS (such as ZooKeeper3.8.x) from the official ApacheZooKeeper website. Use the wget command to download and replace zookeeper-3.8.x with the actual version number: wgethttps://downloads.apache.or

How to configure Nginx in Windows? Install Nginx and create a virtual host configuration. Modify the main configuration file and include the virtual host configuration. Start or reload Nginx. Test the configuration and view the website. Selectively enable SSL and configure SSL certificates. Selectively set the firewall to allow port 80 and 443 traffic.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

In Linux, use the following command to check whether Nginx is started: systemctl status nginx judges based on the command output: If "Active: active (running)" is displayed, Nginx is started. If "Active: inactive (dead)" is displayed, Nginx is stopped.

Steps to start Nginx in Linux: Check whether Nginx is installed. Use systemctl start nginx to start the Nginx service. Use systemctl enable nginx to enable automatic startup of Nginx at system startup. Use systemctl status nginx to verify that the startup is successful. Visit http://localhost in a web browser to view the default welcome page.
