Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kirk

Pages: [1]
1
CentOS 7 Problems / Re: Errors Compiling Imagick for PHP
« on: October 27, 2021, 11:58:45 PM »
I ran a yum update today and tried the CWP install script again...still broken.  However I recently discovered I can still use the regular PECL install commands in conjunction with CWP to fix broken stuff...

I manually installed the PECL manually over SSH:

# pecl install imagick

That seemed to work fine and installed it for the system version of PHP.



I still wish CWP would fix this obvious bug... does no one use imagick anymore?  How has this not gotten any attention or replies??

2
I encountered exactly this same problem but on AlmaLinux 8.

Code: [Select]
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
--2021-10-27 15:28:45--  https://pecl.php.net/get/mcrypt-1.0.1.tgz
Resolving pecl.php.net (pecl.php.net)... 104.236.228.160
Connecting to pecl.php.net (pecl.php.net)|104.236.228.160|:443... connected.
ERROR: The certificate of 'pecl.php.net' is not trusted.
ERROR: The certificate of 'pecl.php.net' was signed using an insecure algorithm.
tar: mcrypt-*: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
/usr/local/cwpsrv/htdocs/resources/conf/el8/php_switcher/external_modules/7.4/mcrypt.sh: line 7: cd: mcrypt-*/: No such file or directory
Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module

/usr/local/cwpsrv/htdocs/resources/conf/el8/php_switcher/external_modules/7.4/mcrypt.sh: line 9: ./configure: No such file or directory
make: *** No targets specified and no makefile found.  Stop.

I was able to solve the problem by manually installing the PECL myself from the command line.

# pecl install mcrypt

We aren't using the multi PHP version switcher, so this installed the PECL for the one and only system version of PHP.  If you're using the version switcher you might have to do the installation a bit differently.

Nonetheless the PECL install worked fine.  I will just make a note of this so it can be done manually if we ever re-build PHP again and the process happens to fail again.

Also all the nonsense about this being a CentOS 8 issue seems to be nonsense - AlmaLinux is not CentOS. :P  It seems like there's a bug here which CWP should look into.

However part of the issue seems to be the download failing due to an invalid SSL certificate, I'm not sure why because the SSL certificate seems fine in my browser.  In fact I can wget the same URL and I don't see any certificate problems.

Code: [Select]
[root@server ~]# wget -O /dev/null https://pecl.php.net/get/mcrypt-1.0.1.tgz
--2021-10-27 18:55:45--  https://pecl.php.net/get/mcrypt-1.0.1.tgz
Resolving pecl.php.net (pecl.php.net)... 104.236.228.160
Connecting to pecl.php.net (pecl.php.net)|104.236.228.160|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 33782 (33K) [application/octet-stream]
Saving to: ‘/dev/null’

100%[======================================>] 33,782      --.-K/s   in 0.009s 

2021-10-27 18:55:45 (3.54 MB/s) - ‘/dev/null’ saved [33782/33782]

3
CentOS 7 Problems / Re: spam from server with no email accounts
« on: August 18, 2021, 11:50:19 PM »
Do you have a "Contact Us" form on one of the websites you are hosting?  There doesn't need to be an existing email account for a website to send emails, it could be sending the email using the PHP mail() function for example.

It sounds to me like there is a Contact form somewhere with no captcha protection, and it's getting submitted with junk contents, and the website was configured to email the forms to you.

The headers of the email may show you the originating PHP script that sent the email.  Once you find it, you can disable or change it as needed.

4
If you do not have a separate partition for /var/ you may find some old log files in /var/log/ you can delete to free up space.

There are some methods you can use to find the largest files\folders consuming disk space as well:
https://www.tutorialspoint.com/find-the-largest-top-10-files-and-directories-on-a-linux

5
CentOS 7 Problems / Errors Compiling Imagick for PHP
« on: August 18, 2021, 11:43:59 PM »
Hello,

I am trying to install Imagick on a CentOS 7 CWP server using the script, /scripts/install_imagick.

At first, we encountered errors about missing files.
Code: [Select]
checking ImageMagick MagickWand API configuration program... found in /usr/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 6.9.10 Q16
checking for MagickWand.h header file... configure: error: Cannot locate header file MagickWand.h
make: *** No rule to make target `clean'.  Stop.
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.

I found a solution to this issue elsewhere: https://topic.alibabacloud.com/article/cant-locate-header-file-magickwandh-error-while-resolving-compilation-imagick-301_3_12_518157.html

The paths were a bit different, but I added functioning symlinks:
/usr/include/ImageMagick
/usr/local/include/ImageMagick

both pointing to existing path:
/usr/include/ImageMagick-6/

This got me further in the process, but I am now encountering new errors and unsure how to proceed further.

Code: [Select]
Configuring for:
PHP Api Version:         20190902
Zend Module Api No:      20190902
Zend Extension Api No:   320190902
ln: failed to create symbolic link ‘/usr/local/include/ImageMagick/ImageMagick-6’: File exists
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
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking whether to enable the imagick GraphicsMagick backend... no
checking ImageMagick MagickWand API configuration program... found in /usr/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 6.9.10 Q16
checking for MagickWand.h header file... found in /usr/include/ImageMagick/wand/MagickWand.h
checking PHP version is at least 5.1.3... yes. found 7.4.14
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
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/*
/bin/sh /usr/local/src/imagick-3.1.0RC2/libtool --mode=compile cc  -I. -I/usr/local/src/imagick-3.1.0RC2 -DPHP_ATOM_INC -I/usr/local/src/imagick-3.1.0RC2/include -I/usr/local/src/imagick-3.1.0RC2/main -I/usr/local/src/imagick-3.1.0RC2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/imagick-3.1.0RC2/imagick_file.c -o imagick_file.lo
mkdir .libs
 cc -I. -I/usr/local/src/imagick-3.1.0RC2 -DPHP_ATOM_INC -I/usr/local/src/imagick-3.1.0RC2/include -I/usr/local/src/imagick-3.1.0RC2/main -I/usr/local/src/imagick-3.1.0RC2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6 -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/imagick-3.1.0RC2/imagick_file.c  -fPIC -DPIC -o .libs/imagick_file.o
In file included from /usr/include/ImageMagick-6/magick/magick-config.h:6:0,
                 from /usr/include/ImageMagick-6/wand/MagickWand.h:29,
                 from /usr/local/src/imagick-3.1.0RC2/php_imagick.h:49,
                 from /usr/local/src/imagick-3.1.0RC2/imagick_file.c:21:
/usr/include/ImageMagick-6/magick/magick-config-64.h:29:3: warning: #warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default" [-Wcpp]
 # warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default"
   ^
/usr/include/ImageMagick-6/magick/magick-config-64.h:30:3: warning: #warning "this is an obsolete behavior please fix your makefile" [-Wcpp]
 # warning "this is an obsolete behavior please fix your makefile"
   ^
/usr/include/ImageMagick-6/magick/magick-config-64.h:52:3: warning: #warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default" [-Wcpp]
 # warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default"
   ^
/usr/include/ImageMagick-6/magick/magick-config-64.h:53:3: warning: #warning "this is an obsolete behavior please fix yours makefile" [-Wcpp]
 # warning "this is an obsolete behavior please fix yours makefile"
   ^
/usr/local/src/imagick-3.1.0RC2/imagick_file.c: In function ‘php_imagick_is_url’:
/usr/local/src/imagick-3.1.0RC2/imagick_file.c:52:2: warning: passing argument 2 of ‘php_stream_locate_url_wrapper’ from incompatible pointer type [enabled by default]
  if (php_stream_locate_url_wrapper(filename, &path_for_open, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC)) {
  ^
In file included from /usr/local/include/php/main/php.h:432:0,
                 from /usr/local/src/imagick-3.1.0RC2/php_imagick.h:40,
                 from /usr/local/src/imagick-3.1.0RC2/imagick_file.c:21:
/usr/local/include/php/main/php_streams.h:569:28: note: expected ‘const char **’ but argument is of type ‘char **’
 PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options);
                            ^
/usr/local/src/imagick-3.1.0RC2/imagick_file.c: In function ‘php_imagick_read_image_using_php_streams’:
/usr/local/src/imagick-3.1.0RC2/imagick_file.c:156:58: error: ‘ENFORCE_SAFE_MODE’ undeclared (first use in this function)
  stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL);
                                                          ^
/usr/local/include/php/main/php_streams.h:572:107: note: in definition of macro ‘php_stream_open_wrapper’
 #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
                                                                                                           ^
/usr/local/src/imagick-3.1.0RC2/imagick_file.c:156:58: note: each undeclared identifier is reported only once for each function it appears in
  stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL);
                                                          ^
/usr/local/include/php/main/php_streams.h:572:107: note: in definition of macro ‘php_stream_open_wrapper’
 #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
                                                                                                           ^
make: *** [imagick_file.lo] Error 1
/bin/sh /usr/local/src/imagick-3.1.0RC2/libtool --mode=compile cc  -I. -I/usr/local/src/imagick-3.1.0RC2 -DPHP_ATOM_INC -I/usr/local/src/imagick-3.1.0RC2/include -I/usr/local/src/imagick-3.1.0RC2/main -I/usr/local/src/imagick-3.1.0RC2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6  -DHAVE_CONFIG_H  -g -O2   -c /usr/local/src/imagick-3.1.0RC2/imagick_file.c -o imagick_file.lo
 cc -I. -I/usr/local/src/imagick-3.1.0RC2 -DPHP_ATOM_INC -I/usr/local/src/imagick-3.1.0RC2/include -I/usr/local/src/imagick-3.1.0RC2/main -I/usr/local/src/imagick-3.1.0RC2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/ImageMagick-6 -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/imagick-3.1.0RC2/imagick_file.c  -fPIC -DPIC -o .libs/imagick_file.o
In file included from /usr/include/ImageMagick-6/magick/magick-config.h:6:0,
                 from /usr/include/ImageMagick-6/wand/MagickWand.h:29,
                 from /usr/local/src/imagick-3.1.0RC2/php_imagick.h:49,
                 from /usr/local/src/imagick-3.1.0RC2/imagick_file.c:21:
/usr/include/ImageMagick-6/magick/magick-config-64.h:29:3: warning: #warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default" [-Wcpp]
 # warning "you should set MAGICKCORE_QUANTUM_DEPTH to sensible default set it to configure time default"
   ^
/usr/include/ImageMagick-6/magick/magick-config-64.h:30:3: warning: #warning "this is an obsolete behavior please fix your makefile" [-Wcpp]
 # warning "this is an obsolete behavior please fix your makefile"
   ^
/usr/include/ImageMagick-6/magick/magick-config-64.h:52:3: warning: #warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default" [-Wcpp]
 # warning "you should set MAGICKCORE_HDRI_ENABLE to sensible default set it to configure time default"
   ^
/usr/include/ImageMagick-6/magick/magick-config-64.h:53:3: warning: #warning "this is an obsolete behavior please fix yours makefile" [-Wcpp]
 # warning "this is an obsolete behavior please fix yours makefile"
   ^
/usr/local/src/imagick-3.1.0RC2/imagick_file.c: In function ‘php_imagick_is_url’:
/usr/local/src/imagick-3.1.0RC2/imagick_file.c:52:2: warning: passing argument 2 of ‘php_stream_locate_url_wrapper’ from incompatible pointer type [enabled by default]
  if (php_stream_locate_url_wrapper(filename, &path_for_open, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC)) {
  ^
In file included from /usr/local/include/php/main/php.h:432:0,
                 from /usr/local/src/imagick-3.1.0RC2/php_imagick.h:40,
                 from /usr/local/src/imagick-3.1.0RC2/imagick_file.c:21:
/usr/local/include/php/main/php_streams.h:569:28: note: expected ‘const char **’ but argument is of type ‘char **’
 PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const char **path_for_open, int options);
                            ^
/usr/local/src/imagick-3.1.0RC2/imagick_file.c: In function ‘php_imagick_read_image_using_php_streams’:
/usr/local/src/imagick-3.1.0RC2/imagick_file.c:156:58: error: ‘ENFORCE_SAFE_MODE’ undeclared (first use in this function)
  stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL);
                                                          ^
/usr/local/include/php/main/php_streams.h:572:107: note: in definition of macro ‘php_stream_open_wrapper’
 #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
                                                                                                           ^
/usr/local/src/imagick-3.1.0RC2/imagick_file.c:156:58: note: each undeclared identifier is reported only once for each function it appears in
  stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL);
                                                          ^
/usr/local/include/php/main/php_streams.h:572:107: note: in definition of macro ‘php_stream_open_wrapper’
 #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
                                                                                                           ^
make: *** [imagick_file.lo] Error 1

This kind of strikes me as a problem with the Makefile or some compatibility issue with the version of the compiler?

Anyone have any suggestions how I can proceed?

Thanks!

Pages: [1]