graphite-web and ubuntu 18.04 - graphite

I am trying to set up graphite-web on a freshly installed ubuntu 18.04 system. I used the apt packet manager, so I got the 1.0.2 version of graphite-web. I finished the configuration als usual, however I got an "Internal Server Error" when trying to open graphite-web in the browser. The apache error log of graphite web says:
[Fri May 25 07:02:47.097839 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] mod_wsgi (pid=13350): Exception occurred processing WSGI script '/usr/share/graphite-web/graphite.wsgi'.
[Fri May 25 07:02:47.102111 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] Traceback (most recent call last):
[Fri May 25 07:02:47.102210 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 157, in __call__
[Fri May 25 07:02:47.102389 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] response = self.get_response(request)
[Fri May 25 07:02:47.102535 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 124, in get_response
[Fri May 25 07:02:47.102706 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] response = self._middleware_chain(request)
[Fri May 25 07:02:47.102964 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 43, in inner
[Fri May 25 07:02:47.103063 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] response = response_for_exception(request, exc)
[Fri May 25 07:02:47.103144 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 93, in response_for_exception
[Fri May 25 07:02:47.103263 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
[Fri May 25 07:02:47.103502 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 143, in handle_uncaught_exception
[Fri May 25 07:02:47.103660 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] return callback(request, **param_dict)
[Fri May 25 07:02:47.103737 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/graphite/views.py", line 11, in server_error
[Fri May 25 07:02:47.103889 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] return HttpResponseServerError( template.render(context) )
[Fri May 25 07:02:47.104044 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/template/backends/django.py", line 64, in render
[Fri May 25 07:02:47.104484 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] context = make_context(context, request, autoescape=self.backend.engine.autoescape)
[Fri May 25 07:02:47.104582 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/template/context.py", line 287, in make_context
[Fri May 25 07:02:47.104868 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] raise TypeError('context must be a dict rather than %s.' % context.__class__.__name__)
[Fri May 25 07:02:47.105070 2018] [wsgi:error] [pid 13350] [remote XXX.XXX.XXX.XXX:XXXX] TypeError: context must be a dict rather than Context.
[Fri May 25 07:02:47.435785 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] mod_wsgi (pid=13387): Exception occurred processing WSGI script '/usr/share/graphite-web/graphite.wsgi'.
[Fri May 25 07:02:47.436040 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] Traceback (most recent call last):
[Fri May 25 07:02:47.436131 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 157, in __call__
[Fri May 25 07:02:47.436272 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] response = self.get_response(request)
[Fri May 25 07:02:47.436386 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 124, in get_response
[Fri May 25 07:02:47.436646 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] response = self._middleware_chain(request)
[Fri May 25 07:02:47.436744 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 43, in inner
[Fri May 25 07:02:47.436876 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] response = response_for_exception(request, exc)
[Fri May 25 07:02:47.437023 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 93, in response_for_exception
[Fri May 25 07:02:47.437173 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
[Fri May 25 07:02:47.437321 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 143, in handle_uncaught_exception
[Fri May 25 07:02:47.437570 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] return callback(request, **param_dict)
[Fri May 25 07:02:47.437755 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/graphite/views.py", line 11, in server_error
[Fri May 25 07:02:47.437960 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] return HttpResponseServerError( template.render(context) )
[Fri May 25 07:02:47.438139 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/template/backends/django.py", line 64, in render
[Fri May 25 07:02:47.438273 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] context = make_context(context, request, autoescape=self.backend.engine.autoescape)
[Fri May 25 07:02:47.438392 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] File "/usr/lib/python2.7/dist-packages/django/template/context.py", line 287, in make_context
[Fri May 25 07:02:47.438609 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] raise TypeError('context must be a dict rather than %s.' % context.__class__.__name__)
[Fri May 25 07:02:47.438816 2018] [wsgi:error] [pid 13387] [remote XXX.XXX.XXX.XXX:XXXX] TypeError: context must be a dict rather than Context.
At first I thought that the dirctory that contains the wsgi script was not owned by the right user, but it turned out that this was not the case. (It is owned by the web-servers user)
Currently I am using python 2.7 but I was able to replicate the problem using python3.
I am running out of ideas. Can anyone help?
Thanks!

I managed to fix this problem inside usr/lib/python2.7/dist-packages/graphite/views.py
by changing
context = Contex({
'stacktrace' : traceback.format_exc()
})
to
context = {
'stacktrace' : traceback.format_exc()
}
The problem was related to this topic:
Django 1.11 TypeError context must be a dict rather than Context

Related

I am getting lsapi:error and it is causing 503 error

The following error is being triggered:
[Wed Oct 19 00:46:51.328670 2022] [lsapi:error] [pid 8996:tid 47089191048960] [client 193.111.60.5:0] [host] Error receiving response header (lsphp is killed?): ReceiveResponseHeader: receive pkg hdr failed: ReceivePkgHdr: nothing to read from backend (LVE ID 1001), check http://docs.cloudlinux.com/mod_lsapi_troubleshooting.html
I added memory limit 4095M which solve this error

Wordpress: When I click in search results, it gives 404

And thanks for your help!
I'm using Wordpress, with WPSearch plugin + elementor custom search page, the problem is:
When the results are displayed, it works flawlessly, but the URl from the title is wrong, and when you click on the the text you get redirected to the main page (I activated 404 errors to be redirected to mainpage). I can't find where to edit those links in search, anyone has any idea?
In cpanel "errors" I can see these:
[Fri Aug 20 19:21:12.443992 2021] [:error] [pid 580957:tid 23099625621248] [client XXX:15408] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/wp-cron.php?doing_wp_cron=1629505272.3485751152038574218750
[Fri Aug 20 19:20:53.445562 2021] [:error] [pid 580956:tid 23099634026240] [client XXX:15364] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/wp-cron.php?doing_wp_cron=1629505253.3393890857696533203125
[Fri Aug 20 19:20:27.565196 2021] [:error] [pid 580957:tid 23099755898624] [client XXX:5056] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7
[Fri Aug 20 19:20:02.575672 2021] [:error] [pid 580956:tid 23099600406272] [client XXX:15268] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/wp-cron.php?doing_wp_cron=1629505202.4825611114501953125000
[Fri Aug 20 19:18:52.393628 2021] [:error] [pid 580957:tid 23099585697536] [client XXX:15122] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/wp-cron.php?doing_wp_cron=1629505132.2978270053863525390625
[Fri Aug 20 19:18:05.437396 2021] [:error] [pid 580956:tid 23099568887552] [client XXX:15056] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/wp-cron.php?doing_wp_cron=1629505085.3480589389801025390625
[Fri Aug 20 19:17:09.918235 2021] [:error] [pid 580957:tid 23099755898624] [client XXX:12736] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7
[Fri Aug 20 19:17:06.951470 2021] [:error] [pid 580956:tid 23099720177408] [client XXX:17024] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7
[Fri Aug 20 19:16:55.437002 2021] [:error] [pid 580954:tid 23099638228736] [client XXX:14866] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/wp-cron.php?doing_wp_cron=1629505015.3463969230651855468750
[Fri Aug 20 19:16:41.682702 2021] [:error] [pid 580957:tid 23099688658688] [client XXX:1038] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/search/condolencias
[Fri Aug 20 19:16:39.020203 2021] [:error] [pid 580958:tid 23099730683648] [client XXX:30395] PHP: syntax error, unexpected '(' in XXXpublic_html/php.ini on line 7, referer: XXX/search/condolencias
Any ideas?
Thank you!

symfony server start - logs multiple times

I've been using symfony server for development for a while now (https://symfony.com/doc/current/setup/symfony_server.html), and everything used to be fine. But lately it started logging messages multiple times.
Ex.
$ ▶ symfony server:start
Tailing Web Server log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Tailing PHP log file (/home/vitals/.symfony/log/87e0a0bd6be99c02b64da0c88ffbc73128fb48bf/7daf403c7589f4927632ed3b6af762a992f09b78.log)
Is taling same log file tens of times. And of course whenever I do something I get output like:
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57810 Closing
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57818 Accepted
[PHP ] [Thu Nov 19 13:18:38 2020] 127.0.0.1:57814 Accepted
Is like is opening on multiple ports instead of one. Any idea why this is happening?

AMPPS Apache is not starting after Restart/ SHutdown on Macbook Pro

Here is the log file
[Tue Jun 09 08:55:52.378786 2020] [mpm_prefork:notice] [pid 2311] AH00163: Apache/2.4.41 (Unix) OpenSSL/1.0.2p PHP/7.3.11 configured -- resuming normal operations
[Tue Jun 09 08:55:52.379156 2020] [core:notice] [pid 2311] AH00094: Command line: '/Applications/AMPPS/apache/bin/httpd'
[Tue Jun 09 08:56:48.228429 2020] [mpm_prefork:notice] [pid 2311] AH00169: caught SIGTERM, shutting down
[Tue Jun 09 08:58:13.964872 2020] [mpm_prefork:notice] [pid 637] AH00163: Apache/2.4.41 (Unix) OpenSSL/1.0.2p PHP/7.3.11 configured -- resuming normal operations
[Tue Jun 09 08:58:13.965557 2020] [core:notice] [pid 637] AH00094: Command line: '/Applications/AMPPS/apache/bin/httpd'
[Tue Jun 09 09:29:02.632112 2020] [cgi:error] [pid 802] [client ::1:49585] AH01215: error on line -1 of /Applications/Ampps/extra/ssl/openssl.cnf: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Tue Jun 09 09:29:02.632746 2020] [cgi:error] [pid 802] [client ::1:49585] AH01215: 4494323308:error:02001002:system library:fopen:No such file or directory:bss_file.c:175:fopen('/Applications/Ampps/extra/ssl/openssl.cnf','rb'): /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Tue Jun 09 09:29:02.632796 2020] [cgi:error] [pid 802] [client ::1:49585] AH01215: 4494323308:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:182:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Tue Jun 09 09:29:02.632887 2020] [cgi:error] [pid 802] [client ::1:49585] AH01215: 4494323308:error:0E078072:configuration file routines:DEF_LOAD:no such file:conf_def.c:201:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Tue Jun 09 09:31:06.009748 2020] [cgi:error] [pid 787] [client ::1:49641] AH01215: AH00526: Syntax error on line 25 of /Applications/AMPPS/apache/conf/extra/httpd-vhosts.conf:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:06.010263 2020] [cgi:error] [pid 787] [client ::1:49641] AH01215: Cannot define multiple Listeners on the same IP:port: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:06.823294 2020] [cgi:error] [pid 787] [client ::1:49641] AH01215: AH00526: Syntax error on line 25 of /Applications/AMPPS/apache/conf/extra/httpd-vhosts.conf:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:06.823357 2020] [cgi:error] [pid 787] [client ::1:49641] AH01215: Cannot define multiple Listeners on the same IP:port: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:20.673005 2020] [cgi:error] [pid 639] [client ::1:49651] AH01215: AH00526: Syntax error on line 25 of /Applications/AMPPS/apache/conf/extra/httpd-vhosts.conf:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:20.673247 2020] [cgi:error] [pid 639] [client ::1:49651] AH01215: Cannot define multiple Listeners on the same IP:port: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:41.530751 2020] [cgi:error] [pid 788] [client ::1:49655] AH01215: AH00526: Syntax error on line 25 of /Applications/AMPPS/apache/conf/extra/httpd-vhosts.conf:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:41.531804 2020] [cgi:error] [pid 788] [client ::1:49655] AH01215: Cannot define multiple Listeners on the same IP:port: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainmanage
[Tue Jun 09 09:31:50.528108 2020] [cgi:error] [pid 802] [client ::1:49660] AH01215: error on line -1 of /Applications/Ampps/extra/ssl/openssl.cnf: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Tue Jun 09 09:31:50.528339 2020] [cgi:error] [pid 802] [client ::1:49660] AH01215: 4724469356:error:02001002:system library:fopen:No such file or directory:bss_file.c:175:fopen('/Applications/Ampps/extra/ssl/openssl.cnf','rb'): /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Tue Jun 09 09:31:50.528386 2020] [cgi:error] [pid 802] [client ::1:49660] AH01215: 4724469356:error:2006D080:BIO routines:BIO_new_file:no such file:bss_file.c:182:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Tue Jun 09 09:31:50.528437 2020] [cgi:error] [pid 802] [client ::1:49660] AH01215: 4724469356:error:0E078072:configuration file routines:DEF_LOAD:no such file:conf_def.c:201:: /Applications/AMPPS/ampps/softaculous/enduser/index.php, referer: http://localhost/ampps/index.php?act=ampps_domainadd
[Wed Jun 10 13:33:31.624306 2020] [mpm_prefork:notice] [pid 637] AH00169: caught SIGTERM, shutting down
In Ampps/apache/conf/httpd.conf
Depends on the version, edit LoadModule php7_module /Applications/AMPPS/php-7.3/libphp7.so as LoadModule php5_module /Applications/AMPPS/php-5.6/libphp5.so
Then restart AMPPS and switch Apache on. If it works, then edit the php version back to php7.

woocommerce_email_attachments not working?

I'm using WP 4.9.9 + WC 3.5.1.
I try to attach image file to email. This is email send after created order.
In order present field named ac_order_customer_image (created with ACF plugin).
In my function.php file present such code:
add_filter( 'woocommerce_email_attachments', 'woocommerce_emails_attach_ac_order_customer_image', 10, 3);
function woocommerce_emails_attach_ac_order_customer_image($attachments, $status, $order) {
error_log('woocommerce_emails_attach_ac_order_customer_image START');
if ( ! is_object( $order ) || ! isset( $status ) ) {
return $attachments;
}
error_log('woocommerce_emails_attach_ac_order_customer_image ORDER and STATUS setted');
if ( empty( $order ) ) {
return $attachments;
}
error_log('woocommerce_emails_attach_ac_order_customer_image ORDER not empty');
$image = get_field('ac_order_customer_image', $order->ID);
error_log('woocommerce_emails_attach_ac_order_customer_image IMAGE: ' . serialize($image));
if ( ! $image ) {
return $attachments;
}
error_log('woocommerce_emails_attach_ac_order_customer_image IMAGE is setted ');
if (is_array($image)){
error_log('woocommerce_emails_attach_ac_order_customer_image IMAGE is ARRAY. Add URL from ARRAY ');
$attachments[] = $image['url'];
}
if (is_int($image)){
error_log('woocommerce_emails_attach_ac_order_customer_image IMAGE is INT. Get URL and ADD ');
$url = wp_get_attachment_image_src($image);
if (is_array($url)){
error_log('woocommerce_emails_attach_ac_order_customer_image IMAGE(ret arr): ' . serialize($url[0]));
$attachments[] = $url[0];
}
if (is_string($url)){
error_log('woocommerce_emails_attach_ac_order_customer_image IMAGE: ' . $url);
$attachments[] = $url;
}
}
if (is_string($image)){
error_log('woocommerce_emails_attach_ac_order_customer_image IMAGE is STRING. Add URL string ');
$attachments[] = $image;
}
error_log('woocommerce_emails_attach_ac_order_customer_image FINISH ');
return $attachments;
}
I receive email but without attachment. What am I do wrong?
PS: error_log:
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image START, referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image ORDER and STATUS setted, referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image ORDER not empty, referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: ID was called incorrectly. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_AJAX::do_wc_ajax, do_action('wc_ajax_checkout'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_order_payment, WC_Gateway_BACS->process_payment, WC_Order->update_status, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_pending_to_on-hold'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_Emails::send_transactional_email, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_Email_Customer_On_Hold_Order->trigger, WC_Email->get_attachments, apply_filters('woocommerce_email_attachments'), WP_Hook->apply_filters, call_user_func_array, woocommerce_emails_attach_ac_order_customer_image, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong. This message was added in version 3.0., referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image IMAGE: i:511;, referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image IMAGE is setted , referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image IMAGE is INT. Get URL and ADD , referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image IMAGE(ret arr): s:134:"http://example.com/wp-content/uploads/2019/01/24774eede17915054f42f2dbd16bee28_client_upload_file_2019_01_03_17_01_05-1-150x150.jpeg";, referer: http://example.com/checkout/
[Thu Jan 03 20:27:08 2019] [warn] [client 95.31.12.33] mod_fcgid: stderr: woocommerce_emails_attach_ac_order_customer_image FINISH , referer: http://example.com/checkout/

Resources