phpenv icon indicating copy to clipboard operation
phpenv copied to clipboard

Unable to build on Linux

Open ngdangtu-vn opened this issue 1 year ago • 3 comments

I receives a lot of error during attempting to run phpenv install 8.*.*. Most of them I can fix it by install whatever internet told me to. However there is one error I couldn't pass:

configure: error: Cannot find libtidy

I tried to install php-tidy, which apt points to php8.1-tidy in my pc, but it still not solve the problem.

Here is my pc:

# uname -a
Linux XXX 6.5.0-10027-tuxedo #31 SMP PREEMPT_DYNAMIC Tue Mar  5 10:45:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

ngdangtu-vn avatar Mar 29 '24 08:03 ngdangtu-vn

Hello @ngdangtu-vn thank for reporting this.

Not sure how comparable Linux is to OSX in this specific circumstance is but, the package that php-build is looking for should be tidy-html5. Could you try to see if it's available for you, install it and try again please?

debo avatar Apr 09 '24 08:04 debo

I believe I don't have it in my distro repo. I'll see if it is easy for me to compile one. But, if possible, do you have other option?

ngdangtu-vn avatar Apr 16 '24 10:04 ngdangtu-vn

The other option would be to disable libtidy through the php-build config options I believe unless you really need it. it might also be that you have to explicitely point the configure to the right path, for example on OSX, due to some quirks with brew and other tools I need to install php with a command similar to the following:

~ PHP_BUILD_CONFIGURE_OPTS="--with-bz2=$(brew --prefix bzip2) --with-iconv=$(brew --prefix libiconv) --with-tidy=$(brew --prefix tidy-html5) --with-zlib-dir=$(brew --prefix zlib) --with-jpeg-dir=$(brew --prefix jpeg) --with-png-dir=$(brew --prefix libpng) --with-libedit=$(brew --prefix libedit) --disable-intl" phpenv install [version]

So maybe you could try something similar under linux. Also, keep in mind that in your case the error is indeed coming from php-build the plugin we use, and not from phpenv itself.

debo avatar Apr 23 '24 12:04 debo

Thanks, I think I finally fixed my problem. The libtidy turned out to be libtidy-dev. Along it is a 2 more other missing libs. After I installed all of them, the machine start ~burning to warm up my loneliness~, I mean start to compiling probably:

sudo apt install libtidy-devel libzip-devel libxslt1-devel

That is my case for Ubuntu-based distro. Hopefully if anyone use ubuntu got stuck like me can fine it useful.

Or you can disable pkg like debo mention if you think it isn't useful for you, saving some space too.

ngdangtu-vn avatar Feb 16 '25 11:02 ngdangtu-vn