Error : Server unable to read htaccess file

ccsnpvt

New member
Joined
Aug 28, 2021
Messages
15
I Got Error from my web:

Forbidden​

You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe


Apache/2.4.41 (Ubuntu) Server at ****.com Port 80

after migration from cPanel to directadmin my some of site working and some of site not working and getting the above error.
can someone please help me.
 
Are you using php-fpm by any chance?
Yes, and Thanks. I have solved that issue by giving permission of the folder but i have issues with some other site "403 Forbidden You don't have permission to access this resource." And some site app are working but backend login is blank page opening.
 
Maybe it helps to enable the "htscanner" option if not enabled yet.
Check this file:
/usr/local/directadmin/custombuild/php_extensions.conf
Look in there if htscanner=yes then you're good.
If it's not present or set to no, do the following as root via SSH (if I remember correctly):
Code:
cd /usr/local/directadmin/custombuild
./build set htscanner yes
./build mod_htscanner2
./build php n
./build rewrite_confs

After that, build htscanner for your php versions:
Code:
./build php_htscanner2 PHP_VERSION
so for example .build php_htscanner2 php-fpm73.

According to the documentation (just had a look again to be sure) you can do it for all php versions at once.
Code:
grep php._release options.conf | cut -d= -f2-2 | grep -v no | awk '{ print "./build php_htscanner2 "$1 }' | sh
related documentation page:

After that all .htaccess files should work again.
 
That is an option, but I don't use the plugin, it can contain bugs. Better check via the system, if you need to build it via the system you can see errors during building (if any) and it learns you to work via SSH.
 
Yes, .htaccess is work after giving the folder permission, but some of subdomain site sowing below error not all after folder permission change .

1630420172930.png
Also can you help me for mail setup, incoming and outgoing issue. When sending the mail to any external mail id its send but not received on external mail and after 24 h we will receive mail that we are re-trying again. not received mail from external mail.
Note: I am migrated from cPanel from backup file.

Thanks
 
Try this command and see if it helps.

cd /usr/local/directadmin/custombuild/scripts ./set_permissions.sh user_homes

As for other help, little I can do without any real domain name or having a look at the system.
 
Maybe it helps to enable the "htscanner" option if not enabled yet.
Check this file:
/usr/local/directadmin/custombuild/php_extensions.conf
Look in there if htscanner=yes then you're good.
If it's not present or set to no, do the following as root via SSH (if I remember correctly):
Code:
cd /usr/local/directadmin/custombuild
./build set htscanner yes
./build mod_htscanner2
./build php n
./build rewrite_confs

After that, build htscanner for your php versions:
Code:
./build php_htscanner2 PHP_VERSION
so for example .build php_htscanner2 php-fpm73.

According to the documentation (just had a look again to be sure) you can do it for all php versions at once.
Code:
grep php._release options.conf | cut -d= -f2-2 | grep -v no | awk '{ print "./build php_htscanner2 "$1 }' | sh
related documentation page:

After that all .htaccess files should work again.
Hi Richard,
I followed your instructions and got these errors:

[root@xxx custombuild]# ./build rewrite_confs
Checking to ensure /etc/httpd/conf/ssl.crt/server.ca is set.
Using 65.108.196.122 for your server IP
Installing Comodo Rule Set for ModSecurity...
############################################################################################################ 100.0%
Updating to latest CWAF client version
current version is up to date
update process finished!
Defaulting to Comodo WAF SecDefaultAction...
Installation of ModSecurity Rule Set has been finished.
PHP has been secured.
Restarting php-fpm56.
Restarting php-fpm74.
Restarting php-fpm80.
Restarting php-fpm82.
Defaulting to Comodo WAF SecDefaultAction...
Restarting apache.
[root@xxx custombuild]# grep php._release options.conf | cut -d= -f2-2 | grep -v no | awk '{ print "./build php_htscanner2 "$1 }' | sh
######################################################################## 100.0%
Found /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz
Extracting /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz...
Installing htscanner2-1.0.1-enhanced PHP extension for PHP 5.6...
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php56
checking for PHP includes... -I/usr/local/php56/include/php -I/usr/local/php56/include/php/main -I/usr/local/php56/include/php/TSRM -I/usr/local/php56/include/php/Zend -I/usr/local/php56/include/php/ext -I/usr/local/php56/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /usr/local/php56/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable htscanner support... yes, shared
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
Trying to make htscanner2-1.0.1-enhanced PHP extension...
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=compile cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php56/include/php -I/usr/local/php56/include/php/main -I/usr/local/php56/include/php/TSRM -I/usr/local/php56/include/php/Zend -I/usr/local/php56/include/php/ext -I/usr/local/php56/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -o htscanner.lo
mkdir .libs
cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php56/include/php -I/usr/local/php56/include/php/main -I/usr/local/php56/include/php/TSRM -I/usr/local/php56/include/php/Zend -I/usr/local/php56/include/php/ext -I/usr/local/php56/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -fPIC -DPIC -o .libs/htscanner.o
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php56/include/php -I/usr/local/php56/include/php/main -I/usr/local/php56/include/php/TSRM -I/usr/local/php56/include/php/Zend -I/usr/local/php56/include/php/ext -I/usr/local/php56/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o htscanner.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules htscanner.lo
cc -shared .libs/htscanner.o -Wl,-soname -Wl,htscanner.so -o .libs/htscanner.so
creating htscanner.la
(cd .libs && rm -f htscanner.la && ln -s ../htscanner.la htscanner.la)
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=install cp ./htscanner.la /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules
cp ./.libs/htscanner.so /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules/htscanner.so
cp ./.libs/htscanner.lai /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules/htscanner.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing htscanner2-1.0.1-enhanced PHP extension...
Installing shared extensions: /usr/local/php56/lib/php/extensions/no-debug-non-zts-20131226/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la modules/* libs/*
htscanner 1.0.1-enhanced is now installed for PHP 5.6.
htscanner2 PHP extension has been installed successfully.
######################################################################## 100.0%
Found /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz
Extracting /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz...
Installing htscanner2-1.0.1-enhanced PHP extension for PHP 7.4...
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local/php74
checking for PHP includes... -I/usr/local/php74/include/php -I/usr/local/php74/include/php/main -I/usr/local/php74/include/php/TSRM -I/usr/local/php74/include/php/Zend -I/usr/local/php74/include/php/ext -I/usr/local/php74/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902
checking for PHP installed headers prefix... /usr/local/php74/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable htscanner support... yes, shared
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
Trying to make htscanner2-1.0.1-enhanced PHP extension...
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=compile cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php74/include/php -I/usr/local/php74/include/php/main -I/usr/local/php74/include/php/TSRM -I/usr/local/php74/include/php/Zend -I/usr/local/php74/include/php/ext -I/usr/local/php74/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -o htscanner.lo
mkdir .libs
cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php74/include/php -I/usr/local/php74/include/php/main -I/usr/local/php74/include/php/TSRM -I/usr/local/php74/include/php/Zend -I/usr/local/php74/include/php/ext -I/usr/local/php74/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -fPIC -DPIC -o .libs/htscanner.o
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php74/include/php -I/usr/local/php74/include/php/main -I/usr/local/php74/include/php/TSRM -I/usr/local/php74/include/php/Zend -I/usr/local/php74/include/php/ext -I/usr/local/php74/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o htscanner.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules htscanner.lo
cc -shared .libs/htscanner.o -Wl,-soname -Wl,htscanner.so -o .libs/htscanner.so
creating htscanner.la
(cd .libs && rm -f htscanner.la && ln -s ../htscanner.la htscanner.la)
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=install cp ./htscanner.la /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules
cp ./.libs/htscanner.so /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules/htscanner.so
cp ./.libs/htscanner.lai /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules/htscanner.la
PATH="$PATH:/sbin" ldconfig -n /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing htscanner2-1.0.1-enhanced PHP extension...
Installing shared extensions: /usr/local/php74/lib/php/extensions/no-debug-non-zts-20190902/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la modules/* libs/*
htscanner 1.0.1-enhanced is now installed for PHP 7.4.
htscanner2 PHP extension has been installed successfully.
######################################################################## 100.0%
Found /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz
Extracting /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz...
Installing htscanner2-1.0.1-enhanced PHP extension for PHP 8.0...
Configuring for:
PHP Api Version: 20200930
Zend Module Api No: 20200930
Zend Extension Api No: 420200930
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local/php80
checking for PHP includes... -I/usr/local/php80/include/php -I/usr/local/php80/include/php/main -I/usr/local/php80/include/php/TSRM -I/usr/local/php80/include/php/Zend -I/usr/local/php80/include/php/ext -I/usr/local/php80/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php80/lib/php/extensions/no-debug-non-zts-20200930
checking for PHP installed headers prefix... /usr/local/php80/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable htscanner support... yes, shared
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
Trying to make htscanner2-1.0.1-enhanced PHP extension...
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=compile cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php80/include/php -I/usr/local/php80/include/php/main -I/usr/local/php80/include/php/TSRM -I/usr/local/php80/include/php/Zend -I/usr/local/php80/include/php/ext -I/usr/local/php80/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -o htscanner.lo
mkdir .libs
cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php80/include/php -I/usr/local/php80/include/php/main -I/usr/local/php80/include/php/TSRM -I/usr/local/php80/include/php/Zend -I/usr/local/php80/include/php/ext -I/usr/local/php80/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -fPIC -DPIC -o .libs/htscanner.o
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:44:1: warning: parameter names (without types) in function declaration
int (*php_cgi_sapi_activate)(TSRMLS_D);
^~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:89:90: error: expected ';', ',' or ')' before 'TSRMLS_DC'
static int value_hnd(char *name, char *value, int flag, int mode, HashTable *ini_entries TSRMLS_DC)
^~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:184:66: error: expected ';', ',' or ')' before 'TSRMLS_DC'
static void parse_config_file(char *file, HashTable *ini_entries TSRMLS_DC)
^~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c: In function 'htscanner_main':
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:325:12: warning: type of 'TSRMLS_D' defaults to 'int' [-Wimplicit-int]
static int htscanner_main(TSRMLS_D) /* {{{ */
^~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:334:133: error: expected ')' before 'TSRMLS_CC'
if (HTG(force_default_docroot) || !sapi_module.getenv || !(doc_root = sapi_module.getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC))) {
^~~~~~~~~~
)
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:363:28: error: 'TSRMLS_C' undeclared (first use in this function); did you mean 'TSRMLS_D'?
t = sapi_get_request_time(TSRMLS_C);
^~~~~~~~
TSRMLS_D
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:363:28: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:363:6: error: too many arguments to function 'sapi_get_request_time'
t = sapi_get_request_time(TSRMLS_C);
^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:29:
/usr/local/php80/include/php/main/SAPI.h:211:17: note: declared here
SAPI_API double sapi_get_request_time(void);
^~~~~~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:424:5: warning: implicit declaration of function 'parse_config_file'; did you mean 'pcre2_config_8'? [-Wimplicit-function-declaration]
parse_config_file(file, ini_entries TSRMLS_CC);
^~~~~~~~~~~~~~~~~
pcre2_config_8
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:424:40: error: expected ')' before 'TSRMLS_CC'
parse_config_file(file, ini_entries TSRMLS_CC);
^~~~~~~~~~
)
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c: In function 'sapi_cgi_activate':
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:444:12: warning: type of 'TSRMLS_D' defaults to 'int' [-Wimplicit-int]
static int sapi_cgi_activate(TSRMLS_D)
^~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:450:25: error: 'TSRMLS_C' undeclared (first use in this function); did you mean 'TSRMLS_D'?
php_cgi_sapi_activate(TSRMLS_C);
^~~~~~~~
TSRMLS_D
make: *** [Makefile:208: htscanner.lo] Error 1
*** The make has failed. Exiting...
######################################################################## 100.0%
Found /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz
Extracting /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz...
Installing htscanner2-1.0.1-enhanced PHP extension for PHP 8.2...
Configuring for:
PHP Api Version: 20220829
Zend Module Api No: 20220829
Zend Extension Api No: 420220829
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local/php82
checking for PHP includes... -I/usr/local/php82/include/php -I/usr/local/php82/include/php/main -I/usr/local/php82/include/php/TSRM -I/usr/local/php82/include/php/Zend -I/usr/local/php82/include/php/ext -I/usr/local/php82/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php82/lib/php/extensions/no-debug-non-zts-20220829
checking for PHP installed headers prefix... /usr/local/php82/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable htscanner support... yes, shared
checking for a sed that does not truncate output... /usr/bin/sed
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
Trying to make htscanner2-1.0.1-enhanced PHP extension...
/bin/sh /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/libtool --mode=compile cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php82/include/php -I/usr/local/php82/include/php/main -I/usr/local/php82/include/php/TSRM -I/usr/local/php82/include/php/Zend -I/usr/local/php82/include/php/ext -I/usr/local/php82/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -o htscanner.lo -MMD -MF htscanner.dep -MT htscanner.lo
mkdir .libs
cc -I. -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/include -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/main -I/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced -I/usr/local/php82/include/php -I/usr/local/php82/include/php/main -I/usr/local/php82/include/php/TSRM -I/usr/local/php82/include/php/Zend -I/usr/local/php82/include/php/ext -I/usr/local/php82/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c -MMD -MF htscanner.dep -MT htscanner.lo -fPIC -DPIC -o .libs/htscanner.o
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:44:1: warning: parameter names (without types) in function declaration
int (*php_cgi_sapi_activate)(TSRMLS_D);
^~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:89:90: error: expected ';', ',' or ')' before 'TSRMLS_DC'
static int value_hnd(char *name, char *value, int flag, int mode, HashTable *ini_entries TSRMLS_DC)
^~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:184:66: error: expected ';', ',' or ')' before 'TSRMLS_DC'
static void parse_config_file(char *file, HashTable *ini_entries TSRMLS_DC)
^~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c: In function 'htscanner_main':
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:325:12: warning: type of 'TSRMLS_D' defaults to 'int' [-Wimplicit-int]
static int htscanner_main(TSRMLS_D) /* {{{ */
^~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:334:133: error: expected ')' before 'TSRMLS_CC'
if (HTG(force_default_docroot) || !sapi_module.getenv || !(doc_root = sapi_module.getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC))) {
^~~~~~~~~~
)
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:363:28: error: 'TSRMLS_C' undeclared (first use in this function); did you mean 'TSRMLS_D'?
t = sapi_get_request_time(TSRMLS_C);
^~~~~~~~
TSRMLS_D
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:363:28: note: each undeclared identifier is reported only once for each function it appears in
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:363:6: error: too many arguments to function 'sapi_get_request_time'
t = sapi_get_request_time(TSRMLS_C);
^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:29:
/usr/local/php82/include/php/main/SAPI.h:211:17: note: declared here
SAPI_API double sapi_get_request_time(void);
^~~~~~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:424:5: warning: implicit declaration of function 'parse_config_file'; did you mean 'pcre2_config_8'? [-Wimplicit-function-declaration]
parse_config_file(file, ini_entries TSRMLS_CC);
^~~~~~~~~~~~~~~~~
pcre2_config_8
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:424:40: error: expected ')' before 'TSRMLS_CC'
parse_config_file(file, ini_entries TSRMLS_CC);
^~~~~~~~~~
)
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c: In function 'sapi_cgi_activate':
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:444:12: warning: type of 'TSRMLS_D' defaults to 'int' [-Wimplicit-int]
static int sapi_cgi_activate(TSRMLS_D)
^~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced/htscanner.c:450:25: error: 'TSRMLS_C' undeclared (first use in this function); did you mean 'TSRMLS_D'?
php_cgi_sapi_activate(TSRMLS_C);
^~~~~~~~
TSRMLS_D
make: *** [Makefile:209: htscanner.lo] Error 1
*** The make has failed. Exiting...
How may I fix them?
 
@Richard G
When I have 2 php versions and have set htscanner then would ./build php provide htscanner for both php versions?
I ask this because in your post #4 you state: so for example .build php_htscanner2 php-fpm73
 
would ./build php provide htscanner for both php versions?
Sorry I don't know. I never use the "provide" command, so no clue on to what that does or what it results in.

I mostly follow the commands in the doc and use things rather default if possible.

However you can test it yourself, try your command. Afterwards check the files in the php versions if they both got the htscanner in it.
You should check /usr/local/phpXX/lib/php.conf.d/10-directadmin.ini where phpXX should be replaced by the php version you want to check.

If you only have 2 php versions, why not just run the command I use twice, for example:
./build php_htscanner2 php-fpm73 ./build php_htscanner2 php-fpm74
 
Ok, checked both 10-directadmin.ini files. Only php1_release has extension=htscanner.so enabled in 10-directadmin.ini
So I tried your suggestion to build htscanner for the second php version.
(you have a typo in the command, it should be: ./build mod_htscanner2 php-fpm81)
This does not add extension=htscanner.so to 10-directadmin.ini for the second php version.
So I added extension=htscanner.so manually in 10-directadmin.ini and restarted the second php version.

My problem described in this thread still exists. (I have downgraded to php 8.1 because 8.2 is still an RC)
.htaccess in the second php version worked as it should! Even before building htscanner for second php version and manually adding extension=htscanner.so to 10-directadmin.ini except for php_value auto_append_file
So no matter what I try I can't get php_value auto_append_file properly to work. It works only for php1_release which is php 7.4.
 
(you have a typo in the command, it should be: ./build mod_htscanner2 php-fpm81)
No I don't have a typo in there. You are mixing up commands.

You can verify it with the docs, so if you think that's wrong, then the docs are wrong.

However, it seems htscanner2 does not support php81 yet. On compile it will give a fail.
Code:
[root@server: /usr/local/directadmin/custombuild]# ./build php_htscanner2 php-fpm81                       
#=#=- #    #                                                                                                                                        
Found /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz
Extracting /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz...
Installing htscanner2-1.0.1-enhanced PHP extension for PHP php-fpm81...
./build: line 10007: /usr/local/phpphp-fpm81/bin/phpize: No such file or directory
./build: line 10008: ./configure: No such file or directory
Trying to make htscanner2-1.0.1-enhanced PHP extension...
make: *** No targets specified and no makefile found.  Stop.
*** The make has failed. Exiting...
 
./build: line 10007: /usr/local/phpphp-fpm81/bin/phpize: No such file or directory
Hmmz... @smtalk is that indeed htscanner not supporting php 8.1? Or is this an issue with the build file?
Because this directory certainly does not exists. Or better said... there is a slash missing between php and php-fpm81.
 
I've had the same error. Look at /usr/local/phpphp-fpm81. phpphp is wrong. That is why I thought I had to use mod_ instead of php_
Code:
[root@host ~]# cd /usr/local/directadmin/custombuild
[root@host custombuild]# ./build php_htscanner2 php-fpm81
##O#- #
Found /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz
Extracting /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz...
Installing htscanner2-1.0.1-enhanced PHP extension for PHP php-fpm81...
./build: line 10451: /usr/local/phpphp-fpm81/bin/phpize: No such file or directo                                                                                        ry
./build: line 10452: ./configure: No such file or directory
Trying to make htscanner2-1.0.1-enhanced PHP extension...
make: *** No targets specified and no makefile found.  Stop.

When I used ./build mod_htscanner2 php-fpm81 all seemed to go ok.
Code:
[root@host custombuild]# ./build mod_htscanner2 php-fpm81
#=#=- #     #
Found /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz
Extracting /usr/local/directadmin/custombuild/htscanner-1.0.1-enhanced.tgz...
Installing mod_htscanner2-1.0.1-enhanced...
/var/www/build/libtool --silent --mode=compile gcc -prefer-pic -I/usr/local/include  -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache  -I/usr/include/apache   -I/usr/include/apache   -c -o mod_htscanner2.lo mod_htscanner2.c && touch mod_htscanner2.slo
/var/www/build/libtool --silent --mode=link gcc -L/usr/local/lib   -o mod_htscanner2.la  -rpath /usr/lib/apache -module -avoid-version    mod_htscanner2.lo
/var/www/build/instdso.sh SH_LIBTOOL='/var/www/build/libtool' mod_htscanner2.la /usr/lib/apache
/var/www/build/libtool --mode=install install mod_htscanner2.la /usr/lib/apache/
libtool: install: install .libs/mod_htscanner2.so /usr/lib/apache/mod_htscanner2.so
libtool: install: install .libs/mod_htscanner2.lai /usr/lib/apache/mod_htscanner2.la
libtool: install: install .libs/mod_htscanner2.a /usr/lib/apache/mod_htscanner2.a
libtool: install: chmod 644 /usr/lib/apache/mod_htscanner2.a
libtool: install: ranlib /usr/lib/apache/mod_htscanner2.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/lib/apache
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/lib/apache

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/lib/apache/mod_htscanner2.so
[activating module `htscanner' in /etc/httpd/conf/httpd.conf]
mod_htscanner2 has been installed successfully.
 
Back
Top