[resolved] LSPHP 8.1.11 Build error on Ubuntu 22.04

sqpp

New Member
#1
Hey,

I have some issues building the latest LSPHP such as LSPHP 8.1.11 on arm64.

Could you please advise at least somewhat and where should I look for?

OS: "22.04.1 LTS (Jammy Jellyfish)"

My compiler flags:
CFLAGS='-g -O2 -fdebug-prefix-map=/build/php8.1-8.1.10=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -fsigned-char -fno-strict-aliasing -g'

My parameters for configure

Code:
'--enable-cgi' '--enable-cli' '--enable-phpdbg=no' '--enable-litespeed' '--with-config-file-path=/usr/local/lsws/lsphp81/etc/php/8.1/litespeed/' '--with-config-file-scan-dir=/usr/local/lsws/lsphp81/etc/php/8.1/mods-available/' '--libdir=/usr/local/lsws/lsphp81/lib/php' '--libexecdir=/usr/local/lsws/lsphp81/lib/php' '--datadir=/usr/local/lsws/lsphp81/share/php/8.1' '--program-suffix=8.1' '--with-pear' '--disable-all' '--disable-debug' '--disable-rpath' '--disable-static' '--with-pic' '--with-layout=GNU' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dom' '--with-enchant' '--enable-exif' '--with-gettext' '--with-gmp' '--enable-fileinfo' '--enable-filter' '--enable-ftp' '--with-iconv' '--enable-mbregex' '--enable-mbstring' '--enable-phar' '--enable-posix' '--enable-mysqlnd-compression-support' '--with-zlib' '--with-openssl=yes' '--with-libedit' '--with-libxml' '--with-bz2' '--enable-session' '--enable-simplexml' '--enable-soap' '--enable-sockets' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--with-mhash=yes' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-zip' '--with-sodium' '--with-password-argon2' '--enable-gd' '--with-jpeg' '--with-xpm' '--with-webp' '--with-freetype' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--disable-dtrace' '--enable-pdo' '--enable-mysqlnd' '--enable-pcntl' '--with-sqlite3=shared,/usr' '--with-pdo-sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' '--with-ldap=shared,/usr' '--with-ldap-sasl=/usr' '--with-snmp=shared,/usr' '--with-pgsql=shared,/usr' '--with-pdo-pgsql=shared,/usr' '--enable-opcache' '--enable-huge-code-pages' '--with-imap=shared,/usr' '--with-kerberos' '--with-imap-ssl=yes' '--with-mysqli=shared,mysqlnd' '--with-pdo-mysql=shared,mysqlnd' '--with-tidy=shared,/usr' '--with-pspell=shared,/usr' '--with-curl=shared,/usr'

The build error:

Code:
In file included from /usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:67:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:84:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   84 | static int (*s_lscapi_dump_me)() = NULL;
      | ^~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:85:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
   85 | static int (*s_lscapi_prepare_me)() = NULL;
      | ^~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:107:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
  107 | int LSAPI_Get_ppid();
      | ^~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c: In function ‘LSCRIU_load_liblscapi’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:244:10: warning: unused variable ‘ch’ [-Wunused-variable]
  244 |     char ch;
      |          ^~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c: At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:399:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
  399 | static void inline LSCRIU_Debugging(void) {}
      | ^~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:400:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration]
  400 | static void inline LSCRIU_Restored_Error(int iFatal, char *format, ...) {}
      | ^~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c: In function ‘LSCRIU_Native_Dump’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:409:33: warning: unused variable ‘criu_native_dump_response’ [-Wunused-variable]
  409 |     criu_native_dump_response_t criu_native_dump_response;
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c: In function ‘LSCRIU_CloudLinux_Checkpoint’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:456:15: warning: unused variable ‘pchError’ [-Wunused-variable]
  456 |         char *pchError;
      |               ^~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c: In function ‘LSCRIU_try_checkpoint’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:531:17: warning: unused variable ‘iPidSender’ [-Wunused-variable]
  531 |         pid_t   iPidSender;
      |                 ^~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:530:17: warning: unused variable ‘iResult’ [-Wunused-variable]
  530 |         int     iResult;
      |                 ^~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:508:11: warning: unused variable ‘iPidDump’ [-Wunused-variable]
  508 |     pid_t iPidDump = getpid();
      |           ^~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:506:9: warning: variable ‘iRet’ set but not used [-Wunused-but-set-variable]
  506 |     int iRet;
      |         ^~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c: At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:554:12: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
  554 | static int init_native_env()
      |            ^~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c: In function ‘LSCRIU_Init_Env_Parameters’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:640:69: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
  640 |             lscriu_dbg("LSCRIU (%d): Use shared memory\n", getpid());
      |                                                                     ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:644:61: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
  644 |         lscriu_dbg("LSCRIU (%d): NOT Listening\n", getpid());
      |                                                             ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:647:10: warning: unused variable ‘ch’ [-Wunused-variable]
  647 |     char ch;
      |          ^~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘sapi_lsapi_ini_defaults’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:141:17: warning: unused variable ‘entry’ [-Wunused-variable]
  141 |     zval *tmp, *entry;
      |                 ^~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:141:11: warning: unused variable ‘tmp’ [-Wunused-variable]
  141 |     zval *tmp, *entry;
      |           ^~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘sapi_lsapi_activate’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:700:22: warning: unused variable ‘doc_root_len’ [-Wunused-variable]
  700 |     size_t path_len, doc_root_len, server_name_len;
      |                      ^~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:699:18: warning: unused variable ‘doc_root’ [-Wunused-variable]
  699 |     char *path, *doc_root, *server_name;
      |                  ^~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:772:5: warning: initialization of ‘char * (*)(const char *, size_t)’ {aka ‘char * (*)(const char *, long unsigned int)’} from incompatible pointer type ‘char * (*)(char *, size_t)’ {aka ‘char * (*)(char *, long unsigned int)’} [-Wincompatible-pointer-types]
  772 |     sapi_lsapi_getenv,              /* getenv */
      |     ^~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:772:5: note: (near initialization for ‘lsapi_sapi_module.getenv’)
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:784:5: warning: initialization of ‘void (*)(const char *, int)’ from incompatible pointer type ‘void (*)(char *, int)’ [-Wincompatible-pointer-types]
  784 |     sapi_lsapi_log_message,         /* Log message */
      |     ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:784:5: note: (near initialization for ‘lsapi_sapi_module.log_message’)
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘lsapi_chdir_primary_script’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:835:29: warning: passing argument 1 of ‘strrchr’ from incompatible pointer type [-Wincompatible-pointer-types]
  835 |     p = strrchr( file_handle->filename, '/' );
      |                  ~~~~~~~~~~~^~~~~~~~~~
      |                             |
      |                             zend_string * {aka struct _zend_string *}
In file included from /usr/local/lsws/phpbuild/php-8.1.11/include/../main/php_config.h:2222,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_config.h:1,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_portability.h:43,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_types.h:25,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend.h:27,
                 from /usr/local/lsws/phpbuild/php-8.1.11/main/php.h:31,
                 from /usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:19:
/usr/include/string.h:273:35: note: expected ‘const char *’ but argument is of type ‘zend_string *’ {aka ‘struct _zend_string *’}
  273 | extern char *strrchr (const char *__s, int __c)
      |                       ~~~~~~~~~~~~^~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:839:33: warning: passing argument 1 of ‘strcmp’ from incompatible pointer type [-Wincompatible-pointer-types]
  839 |         if ( strcmp( file_handle->filename, s_cur_chdir ) != 0 ) {
      |                      ~~~~~~~~~~~^~~~~~~~~~
      |                                 |
      |                                 zend_string * {aka struct _zend_string *}
In file included from /usr/local/lsws/phpbuild/php-8.1.11/include/../main/php_config.h:2222,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_config.h:1,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_portability.h:43,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_types.h:25,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend.h:27,
                 from /usr/local/lsws/phpbuild/php-8.1.11/main/php.h:31,
                 from /usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:19:
/usr/include/string.h:156:32: note: expected ‘const char *’ but argument is of type ‘zend_string *’ {aka ‘struct _zend_string *’}
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:840:31: warning: passing argument 1 of ‘chdir’ from incompatible pointer type [-Wincompatible-pointer-types]
  840 |             chdir( file_handle->filename );
      |                    ~~~~~~~~~~~^~~~~~~~~~
      |                               |
      |                               zend_string * {aka struct _zend_string *}
In file included from /usr/include/aarch64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_signal.h:26,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend.h:41,
                 from /usr/local/lsws/phpbuild/php-8.1.11/main/php.h:31,
                 from /usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:19:
/usr/include/unistd.h:517:31: note: expected ‘const char *’ but argument is of type ‘zend_string *’ {aka ‘struct _zend_string *’}
  517 | extern int chdir (const char *__path) __THROW __nonnull ((1)) __wur;
      |                   ~~~~~~~~~~~~^~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:846:35: warning: passing argument 1 of ‘strcmp’ from incompatible pointer type [-Wincompatible-pointer-types]
  846 |              ( strcmp( file_handle->filename, CWDG(cwd).cwd ) != 0 ) ) {
      |                        ~~~~~~~~~~~^~~~~~~~~~
      |                                   |
      |                                   zend_string * {aka struct _zend_string *}
In file included from /usr/local/lsws/phpbuild/php-8.1.11/include/../main/php_config.h:2222,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_config.h:1,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_portability.h:43,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_types.h:25,
                 from /usr/local/lsws/phpbuild/php-8.1.11/Zend/zend.h:27,
                 from /usr/local/lsws/phpbuild/php-8.1.11/main/php.h:31,
                 from /usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:19:
/usr/include/string.h:156:32: note: expected ‘const char *’ but argument is of type ‘zend_string *’ {aka ‘struct _zend_string *’}
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:847:38: error: invalid operands to binary - (have ‘char *’ and ‘zend_string *’ {aka ‘struct _zend_string *’})
  847 |             CWDG(cwd).cwd_length = p - file_handle->filename;
      |                                      ^ ~~~~~~~~~~~~~~~~~~~~~
      |                                                   |
      |                                                   zend_string * {aka struct _zend_string *}
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘lsapi_fopen_primary_script’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:871:27: warning: assignment to ‘zend_string *’ {aka ‘struct _zend_string *’} from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
  871 |     file_handle->filename = SG(request_info).path_translated;
      |                           ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:872:18: error: ‘zend_file_handle’ {aka ‘struct _zend_file_handle’} has no member named ‘free_filename’; did you mean ‘filename’?
  872 |     file_handle->free_filename = 0;
      |                  ^~~~~~~~~~~~~
      |                  filename
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:863:12: warning: unused variable ‘p’ [-Wunused-variable]
  863 |     char * p;
      |            ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘lsapi_execute_script’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:885:27: warning: assignment to ‘zend_string *’ {aka ‘struct _zend_string *’} from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
  885 |     file_handle->filename = SG(request_info).path_translated;
      |                           ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:919:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
  919 | static void lsapi_clean_shutdown()
      |             ^~~~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘lsapi_clean_shutdown’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:922:9: warning: variable ‘sa_rc’ set but not used [-Wunused-but-set-variable]
  922 |     int sa_rc;
      |         ^~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘lsapi_module_main’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:983:9: warning: variable ‘sa_rc’ set but not used [-Wunused-but-set-variable]
  983 |     int sa_rc;
      |         ^~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1098:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
1098 | static void user_config_cache_init()
      |             ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘lsapi_activate_user_ini_walk_down_the_path’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1331:10: warning: unused variable ‘path_len’ [-Wunused-variable]
1331 |     uint path_len, docroot_len;
      |          ^~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1416:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
1416 | static void override_ini()
      |             ^~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘cli_main’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1663:50: warning: assignment to ‘zend_string *’ {aka ‘struct _zend_string *’} from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
1663 |                             file_handle.filename = *p;
      |                                                  ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1664:41: error: ‘zend_file_handle’ {aka ‘struct _zend_file_handle’} has no member named ‘free_filename’; did you mean ‘filename’?
1664 |                             file_handle.free_filename = 0;
      |                                         ^~~~~~~~~~~~~
      |                                         filename
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1668:76: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘zend_string *’ {aka ‘struct _zend_string *’} [-Wformat=]
1668 |                                 zend_printf("No syntax errors detected in %s\n", file_handle.filename);
      |                                                                           ~^     ~~~~~~~~~~~~~~~~~~~~
      |                                                                            |                |
      |                                                                            char *           zend_string * {aka struct _zend_string *}
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1670:62: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘zend_string *’ {aka ‘struct _zend_string *’} [-Wformat=]
1670 |                                 zend_printf("Errors parsing %s\n", file_handle.filename);
      |                                                             ~^     ~~~~~~~~~~~~~~~~~~~~
      |                                                              |                |
      |                                                              char *           zend_string * {aka struct _zend_string *}
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1674:50: warning: assignment to ‘zend_string *’ {aka ‘struct _zend_string *’} from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
1674 |                             file_handle.filename = *p;
      |                                                  ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1675:41: error: ‘zend_file_handle’ {aka ‘struct _zend_file_handle’} has no member named ‘free_filename’; did you mean ‘filename’?
1675 |                             file_handle.free_filename = 0;
      |                                         ^~~~~~~~~~~~~
      |                                         filename
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘main’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1896:9: warning: unused variable ‘iRequestsProcessed’ [-Wunused-variable]
1896 |     int iRequestsProcessed = 0;
      |         ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1970:5: warning: missing initializer for field ‘num_args’ of ‘zend_function_entry’ {aka ‘struct _zend_function_entry’} [-Wmissing-field-initializers]
1970 |     {NULL, NULL, NULL}
      |     ^
In file included from /usr/local/lsws/phpbuild/php-8.1.11/main/php.h:35,
                 from /usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:19:
/usr/local/lsws/phpbuild/php-8.1.11/Zend/zend_API.h:39:18: note: ‘num_args’ declared here
   39 |         uint32_t num_args;
      |                  ^~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c: In function ‘parse_opt’:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1513:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
1513 |             if ( *((*(p-1))+2) == 's' )
      |                ^
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:1515:9: note: here
1515 |         case 'h':
      |         ^~~~
At top level:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:860:12: warning: ‘lsapi_fopen_primary_script’ defined but not used [-Wunused-function]
  860 | static int lsapi_fopen_primary_script( zend_file_handle * file_handle )
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lsapi_main.c:67:
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:305:14: warning: ‘LSCRIU_Error_File_Name’ defined but not used [-Wunused-function]
  305 | static char *LSCRIU_Error_File_Name(char *pchFile, int max_len)
      |              ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-8.1.11/sapi/litespeed/lscriu.c:88:12: warning: ‘s_criu_debug’ defined but not used [-Wunused-variable]
   88 | static int s_criu_debug = 0;
      |            ^~~~~~~~~~~~
make: *** [Makefile:626: sapi/litespeed/lsapi_main.lo] Error 1
**ERROR** Could not compile PHP
 
#4
For other users hitting this error later, like me:

* User sqpp discussed the problem in this GitHub issue, and posted "I managed to solve it by redownloading the legit PHP source and replacing the folder" as a solution.
* However what worked for me was the other suggested solution: change LSAPI_VERSION in build_phpto fit the PHP version. I set it in /usr/local/lsws/admin/html/lib/util/build_php/BuildConfig.php fixing the line case self::LSAPI_VERSION: return '8.1'; since I was installing PHP 8.1 .

The PHP build went without errors then.
 
Top