Xmode.org

Environment Dependency

x
x

Table of Contents

  1. Missing of zlib while using pyenv
  2. Solution for macOS
  3. Solution for Linux Mint
  4. Solution for Ubuntu
  5. Dependency for phpenv
  6. About BZip2 distribution
  7. Error message
  8. Solution
  9. No package 'libcurl' found
  10. Error message
  11. Solution
  12. No package 'libjpeg' found
  13. Error message
  14. Solution
  15. No package 'oniguruma' found
  16. Error message
  17. Solution
  18. Cannot find libtidy
  19. Error message
  20. Solution
  21. No package 'libzip' found
  22. Error message
  23. Solution
  24. Summary
  25. Finished with error while building php
  26. TL;DR for php installation

This article is just a personal note. I'm happy if the content of this article helps you, feel free to use it.

Missing of zlib while using pyenv

pyenv install <version>

Some errors about missing of zlib?

Solution for macOS

xcode-select --install

Solution for Linux Mint

apt install git gcc make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev

Solution for Ubuntu

apt install zlib1g-dev

Dependency for phpenv

phpenv install <version>
phpenv install 8.0.2

About BZip2 distribution

Error message

configure: error: Please reinstall the BZip2 distribution

Solution1

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

No package 'libcurl' found

Error message

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: error: Package requirements (libcurl >= 7.29.0) were not met:

No package 'libcurl' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables CURL_CFLAGS
and CURL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------

Solution

sudo apt install libcurl4-openssl-dev

No package 'libjpeg' found

Error message

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: error: Package requirements (libjpeg) were not met:

No package 'libjpeg' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables JPEG_CFLAGS
and JPEG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------

Solution

sudo apt install libjpeg-dev

No package 'oniguruma' found

Error message

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: error: Package requirements (oniguruma) were not met:

No package 'oniguruma' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ONIG_CFLAGS
and ONIG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------

Solution

  • Ubuntu, Linux Mint, Debian

    sudo apt install libonig-dev
    
  • macOS

    brew install oniguruma
    

Cannot find libtidy

Error message

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
configure: error: Cannot find libtidy
-----------------------------------------

Solution

sudo apt install libtidy-dev

No package 'libzip' found

Error message

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
No package 'libzip' found
No package 'libzip' found
No package 'libzip' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBZIP_CFLAGS
and LIBZIP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
-----------------------------------------

Solution

  • Ubuntu, Linux Mint, Debian

    sudo apt install libzip-dev
    
  • macOS

    brew install libzip
    

Summary

Test on Linux Mint.

ProblemDid
libxml2 not foundapt install libxml2-dev
jpeglib.h not foundapt install libjpeg-dev
png.h not foundapt install libpng-dev
cannot find libtidyapt install libtidy-dev
xslt-config not foundapt install libxslt-dev
please reinstall the libzipapt install libzip-dev
You will need re2c 0.13.4apt install re2c

Finished with error while building php

Finished with error but php -v is ok.

[Info]: Loaded extension plugin
[Info]: Loaded apc Plugin.
[Info]: Loaded composer Plugin.
[Info]: Loaded github Plugin.
[Info]: Loaded uprofiler Plugin.
[Info]: Loaded xdebug Plugin.
[Info]: Loaded xhprof Plugin.
[Info]: Loaded zendopcache Plugin.
[Info]: php.ini-production gets used as php.ini
[Info]: Building 8.0.2 into /home/xin/.anyenv/envs/phpenv/versions/8.0.2
[Skipping]: Already downloaded and extracted https://secure.php.net/distributions/php-8.0.2.tar.bz2
[Preparing]: /tmp/php-build/source/8.0.2
[Compiling]: /tmp/php-build/source/8.0.2

[xdebug]: Installing version 3.0.2
[Downloading]: http://xdebug.org/files/xdebug-3.0.2.tgz
[xdebug]: Compiling xdebug in /tmp/php-build/source/xdebug-3.0.2

-----------------
|  BUILD ERROR  |
-----------------

Here are the last 10 lines from the log:

-----------------------------------------
mkdir: cannot create directory 'ext/intl/timezone/.libs': File exists
mkdir: cannot create directory 'ext/json/.libs': File exists
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
-----------------------------------------

The full Log is available at '/tmp/php-build.8.0.2.20210222032151.log'.
[Warn]: Aborting build.

TL;DR for php installation

sudo apt install libcurl4-openssl-dev libjpeg-dev libonig-dev libtidy-dev libzip-dev
Footnotes