yzeng25 commented on a change in pull request #6442: URL: https://github.com/apache/apisix/pull/6442#discussion_r817366669
########## File path: docs/zh/latest/how-to-build.md ########## @@ -113,9 +113,25 @@ sudo yum install ./apisix/*.rpm make install ``` -- 4.1 `make deps` 安装 `lualdap` 失败, 错误信息如: `Could not find header file for LDAP` + **注意**:使用 `make deps` 安装 `lualdap`、`PCRE`、`openssl` 等依赖包失败, 错误信息如: `Could not find header file for LDAP/PCRE/openssl`,可使用本方法解决。 - 解决方案: 通过 `luarocks config` 手动设置 `LDAP_DIR` 变量, 比如 `luarocks config variables.LDAP_DIR /usr/local/opt/openldap/` + 解决思路:`luarocks` 支持添加自定义包到项目中(参考自[链接](https://github.com/luarocks/luarocks/wiki/Config-file-format))。使用第三方工具安装缺失的包,并将其安装目录添加到项目的配置文件中。方法适用于 macOS、ubuntu、Centos 等主流操作系统,此处暂给出 macOS 的具体解决步骤仅供参考。 + + macOS 具体解决步骤: + + 1. 使用 `brew install openldap` 命令将 `openldap` 安装到本地; Review comment: ```suggestion 1. 使用 `brew install openldap` 命令将 `openldap` 安装到本地; ``` ########## File path: docs/zh/latest/how-to-build.md ########## @@ -113,9 +113,25 @@ sudo yum install ./apisix/*.rpm make install ``` -- 4.1 `make deps` 安装 `lualdap` 失败, 错误信息如: `Could not find header file for LDAP` + **注意**:使用 `make deps` 安装 `lualdap`、`PCRE`、`openssl` 等依赖包失败, 错误信息如: `Could not find header file for LDAP/PCRE/openssl`,可使用本方法解决。 - 解决方案: 通过 `luarocks config` 手动设置 `LDAP_DIR` 变量, 比如 `luarocks config variables.LDAP_DIR /usr/local/opt/openldap/` + 解决思路:`luarocks` 支持添加自定义包到项目中(参考自[链接](https://github.com/luarocks/luarocks/wiki/Config-file-format))。使用第三方工具安装缺失的包,并将其安装目录添加到项目的配置文件中。方法适用于 macOS、ubuntu、Centos 等主流操作系统,此处暂给出 macOS 的具体解决步骤仅供参考。 Review comment: ```suggestion 解决思路:`luarocks` 支持添加自定义包到项目中(参考自[luarocks Config file format](https://github.com/luarocks/luarocks/wiki/Config-file-format))。使用第三方工具安装缺失的包,并将其安装目录添加到项目的配置文件中。方法适用于 macOS、Ubuntu、CentOS 等主流操作系统,此处暂给出 macOS 的具体解决步骤仅供参考。 ``` ########## File path: docs/zh/latest/how-to-build.md ########## @@ -113,9 +113,25 @@ sudo yum install ./apisix/*.rpm make install ``` -- 4.1 `make deps` 安装 `lualdap` 失败, 错误信息如: `Could not find header file for LDAP` + **注意**:使用 `make deps` 安装 `lualdap`、`PCRE`、`openssl` 等依赖包失败, 错误信息如: `Could not find header file for LDAP/PCRE/openssl`,可使用本方法解决。 - 解决方案: 通过 `luarocks config` 手动设置 `LDAP_DIR` 变量, 比如 `luarocks config variables.LDAP_DIR /usr/local/opt/openldap/` + 解决思路:`luarocks` 支持添加自定义包到项目中(参考自[链接](https://github.com/luarocks/luarocks/wiki/Config-file-format))。使用第三方工具安装缺失的包,并将其安装目录添加到项目的配置文件中。方法适用于 macOS、ubuntu、Centos 等主流操作系统,此处暂给出 macOS 的具体解决步骤仅供参考。 + + macOS 具体解决步骤: + + 1. 使用 `brew install openldap` 命令将 `openldap` 安装到本地; + 2. 使用 `brew --prefix openldap` 命令找到本地安装目录; + 3. 将路径添加到项目配置文件中(选择两种方法中的一种即可): + 1. 方法一:通过 `luarocks config` 手动设置 `LDAP_DIR` 变量, 比如 `luarocks config variables.LDAP_DIR /opt/homebrew/cellar/openldap/2.6.1`; + 2. 方法二:当然你也可以选择直接更改 luarocks 的默认配置文件,执行 `cat ~/.luarocks/config-5.1.lua` 命令,然后在文件中添加 `openldap` 的安装目录; + 3. 参考配置文件示例如下: + variables = { + LDAP_DIR = "/opt/homebrew/cellar/openldap/2.6.1", + LDAP_INCDIR = "/opt/homebrew/cellar/openldap/2.6.1/include", + } Review comment: You might want to add ` ``` ` to represent them as a code block ```suggestion ``` variables = { LDAP_DIR = "/opt/homebrew/cellar/openldap/2.6.1", LDAP_INCDIR = "/opt/homebrew/cellar/openldap/2.6.1/include", } ``` ``` ########## File path: docs/en/latest/how-to-build.md ########## @@ -117,9 +117,25 @@ Follow the steps below to install Apache APISIX via the source release package. make install ``` - **Note**: If `make deps` fails with "install `lualdap` failed" with an error like `Could not find header file for LDAP` try the solution below. + **Note**: If you fail to install dependency packages using `make deps` and get an error message like `Could not find header file for LDAP/PCRE/openssl`, you can use this general method to solve problems. - Solution: Set `LDAP_DIR` with `luarocks config` manually. For example `luarocks config variables.LDAP_DIR /usr/local/opt/openldap/`. + The general solution: `luarocks` supports adding custom packages to projects(from this [link](https://github.com/luarocks/luarocks/wiki/Config-file-format)). Use a third-party tool to install the missing package and add its installation directory to the project's configuration file. The method is applied to macOS, ubuntu, Centos and other operating systems, and the specific solution for macOS are given here for reference only. + + Solution for macOS: + + 1. Install `openldap` with `brew install openldap`; + 2. Locate installation directory with `brew --prefix openldap`; + 3. Add the path to the project configuration file(choose one of the following two methods): + 1. Solution A: You can set `LDAP_DIR` with `luarocks config` manually, for example `luarocks config variables.LDAP_DIR /opt/homebrew/cellar/openldap/2.6.1`; + 2. Solution B: Of course, you can also choose to change the default configuration file of luarocks directly, execute the 'cat ~/.luarocks/config-5.1.lua' command, and then add the installation directory of 'openldap' to the file; + 3. Example as follows: + variables = { + LDAP_DIR = "/opt/homebrew/cellar/openldap/2.6.1", + LDAP_INCDIR = "/opt/homebrew/cellar/openldap/2.6.1/include", + } + + `/opt/homebrew/cellar/openldap/` is default path to install openldap on macOS(Apple Silicon) using brew. + `/usr/local/opt/openldap/` is default path to install openldap on macOS(Intel)using brew. Review comment: ```suggestion `/usr/local/opt/openldap/` is default path to install openldap on macOS(Intel) using brew. ``` ########## File path: docs/zh/latest/how-to-build.md ########## @@ -113,9 +113,25 @@ sudo yum install ./apisix/*.rpm make install ``` -- 4.1 `make deps` 安装 `lualdap` 失败, 错误信息如: `Could not find header file for LDAP` + **注意**:使用 `make deps` 安装 `lualdap`、`PCRE`、`openssl` 等依赖包失败, 错误信息如: `Could not find header file for LDAP/PCRE/openssl`,可使用本方法解决。 Review comment: ```suggestion **注意**:使用 `make deps` 安装 `lualdap`、`PCRE`、`openssl` 等依赖包失败,错误信息如: `Could not find header file for LDAP/PCRE/openssl`,可使用本方法解决。 ``` ########## File path: docs/en/latest/how-to-build.md ########## @@ -117,9 +117,25 @@ Follow the steps below to install Apache APISIX via the source release package. make install ``` - **Note**: If `make deps` fails with "install `lualdap` failed" with an error like `Could not find header file for LDAP` try the solution below. + **Note**: If you fail to install dependency packages using `make deps` and get an error message like `Could not find header file for LDAP/PCRE/openssl`, you can use this general method to solve problems. - Solution: Set `LDAP_DIR` with `luarocks config` manually. For example `luarocks config variables.LDAP_DIR /usr/local/opt/openldap/`. + The general solution: `luarocks` supports adding custom packages to projects(from this [link](https://github.com/luarocks/luarocks/wiki/Config-file-format)). Use a third-party tool to install the missing package and add its installation directory to the project's configuration file. The method is applied to macOS, ubuntu, Centos and other operating systems, and the specific solution for macOS are given here for reference only. + + Solution for macOS: + + 1. Install `openldap` with `brew install openldap`; + 2. Locate installation directory with `brew --prefix openldap`; + 3. Add the path to the project configuration file(choose one of the following two methods): + 1. Solution A: You can set `LDAP_DIR` with `luarocks config` manually, for example `luarocks config variables.LDAP_DIR /opt/homebrew/cellar/openldap/2.6.1`; + 2. Solution B: Of course, you can also choose to change the default configuration file of luarocks directly, execute the 'cat ~/.luarocks/config-5.1.lua' command, and then add the installation directory of 'openldap' to the file; + 3. Example as follows: + variables = { + LDAP_DIR = "/opt/homebrew/cellar/openldap/2.6.1", + LDAP_INCDIR = "/opt/homebrew/cellar/openldap/2.6.1/include", + } Review comment: You might want to add ` ``` ` to represent them as a code block ```suggestion ``` variables = { LDAP_DIR = "/opt/homebrew/cellar/openldap/2.6.1", LDAP_INCDIR = "/opt/homebrew/cellar/openldap/2.6.1/include", } ``` ``` ########## File path: docs/en/latest/how-to-build.md ########## @@ -117,9 +117,25 @@ Follow the steps below to install Apache APISIX via the source release package. make install ``` - **Note**: If `make deps` fails with "install `lualdap` failed" with an error like `Could not find header file for LDAP` try the solution below. + **Note**: If you fail to install dependency packages using `make deps` and get an error message like `Could not find header file for LDAP/PCRE/openssl`, you can use this general method to solve problems. - Solution: Set `LDAP_DIR` with `luarocks config` manually. For example `luarocks config variables.LDAP_DIR /usr/local/opt/openldap/`. + The general solution: `luarocks` supports adding custom packages to projects(from this [link](https://github.com/luarocks/luarocks/wiki/Config-file-format)). Use a third-party tool to install the missing package and add its installation directory to the project's configuration file. The method is applied to macOS, ubuntu, Centos and other operating systems, and the specific solution for macOS are given here for reference only. Review comment: ```suggestion The general solution: `luarocks` supports adding custom packages to projects(from this [luarocks Config file format](https://github.com/luarocks/luarocks/wiki/Config-file-format)). Use a third-party tool to install the missing package and add its installation directory to the project's configuration file. The method is applied to macOS, Ubuntu, CentOS and other operating systems, and the specific solution for macOS are given here for reference only. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
