-
Couldn't load subscription status.
- Fork 8k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Description
Since the PPA repository for PHP from ondrej/php have not supported ubuntu 24.10 yet, I compiled and install php from scratch.
Steps to replicate:
- wget https://www.php.net/distributions/php-8.1.0.tar.bz2
- tar -xjf php-8.1.0.tar.bz2
- cd php-8.1.0
- ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-fpm --with-mysqli --with-openssl --enable-bcmath --with-curl
- make
- sudo make install
Error found:
<username>@raspberrypi:~/php-8.1.0$ sudo make install
/bin/bash /home/<username>/php-8.1.0/libtool --silent --preserve-dup-deps --tag CC --mode=compile cc -Iext/libxml/ -I/home/<username>/php-8.1.0/ext/libxml/ -I/home/<username>/php-8.1.0/include -I/home/<username>/php-8.1.0/main -I/home/<username>/php-8.1.0 -I/home/<username>/php-8.1.0/ext/date/lib -I/usr/include/libxml2 -I/home/<username>/php-8.1.0/TSRM -I/home/<username>/php-8.1.0/Zend -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /home/<username>/php-8.1.0/ext/libxml/libxml.c -o ext/libxml/libxml.lo -MMD -MF ext/libxml/libxml.dep -MT ext/libxml/libxml.lo
/home/<username>/php-8.1.0/ext/libxml/libxml.c: In function ‘php_libxml_shutdown’:
/home/<username>/php-8.1.0/ext/libxml/libxml.c:778:17: warning: ‘xmlRelaxNGCleanupTypes’ is deprecated [-Wdeprecated-declarations]
778 | xmlRelaxNGCleanupTypes();
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/<username>/php-8.1.0/ext/libxml/libxml.c:39:
/usr/include/libxml2/libxml/relaxng.h:124:21: note: declared here
124 | xmlRelaxNGCleanupTypes (void);
| ^~~~~~~~~~~~~~~~~~~~~~
/home/<username>/php-8.1.0/ext/libxml/libxml.c: In function ‘zif_libxml_use_internal_errors’:
/home/<username>/php-8.1.0/ext/libxml/libxml.c:979:48: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
979 | if (current_handler && current_handler == php_libxml_structured_error_handler) {
| ^~
/home/<username>/php-8.1.0/ext/libxml/libxml.c:997:49: error: passing argument 2 of ‘xmlSetStructuredErrorFunc’ from incompatible pointer type [-Wincompatible-pointer-types]
997 | xmlSetStructuredErrorFunc(NULL, php_libxml_structured_error_handler);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
In file included from /usr/include/libxml2/libxml/valid.h:15,
from /usr/include/libxml2/libxml/parser.h:19,
from /home/<username>/php-8.1.0/ext/libxml/libxml.c:32:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
898 | xmlStructuredErrorFunc handler);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/<username>/php-8.1.0/ext/libxml/libxml.c: In function ‘zif_libxml_get_last_error’:
/home/<username>/php-8.1.0/ext/libxml/libxml.c:1014:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
1014 | error = xmlGetLastError();
| ^
make: *** [Makefile:665: ext/libxml/libxml.lo] Error 1
This error suggests a mismatch between the expected function signature and the actual function being passed to xmlSetStructuredErrorFunc
Workaround:
sudo apt-get install libxml2-dev
And then I have edited 8.1.0/ext/libxml/libxml.c:997 to
xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc) php_libxml_structured_error_handler);
Re-run sudo make install and then php successfully installed.
PHP Version
8.1.0
Operating System
24.10
FRedhunter