Dovecot service starting failed centos, CyberPanel - php

Main Error
`● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2023-02-09 12:10:36 UTC; 3min 7s ago
Docs: man:dovecot(1)
https://doc.dovecot.org/
Process: 1110 ExecStart=/usr/sbin/dovecot -F (code=exited, status=89)
Process: 1106 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 1110 (code=exited, status=89)
Jan 24 02:01:01 vps.marketingmore.in dovecot[537335]: master: Warning: Killed with signal 15 (by pid=642212 uid=0 code=kill)
Jan 24 02:01:02 vps.marketingmore.in systemd[1]: Stopped Dovecot IMAP/POP3 email server.
Jan 24 02:01:02 vps.marketingmore.in systemd[1]: Starting Dovecot IMAP/POP3 email server...
Jan 24 02:01:03 vps.marketingmore.in prestartscript[642249]: Failed to get unit file state for NetworkManager.service: No such file or directory
Jan 24 02:01:03 vps.marketingmore.in systemd[1]: Started Dovecot IMAP/POP3 email server.
Jan 24 02:01:03 vps.marketingmore.in dovecot[642252]: master: Dovecot v2.3.19.1 (9b53102964) starting up for imap, pop3 (core dumps disabled)
Jan 24 03:32:27 vps.marketingmore.in dovecot[642254]: pop3-login: Disconnected: Connection closed: SSL_accept() failed: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol (no auth attempts in 3 secs): user=<>, rip=172.105.147.229, lip=191.101.3.153, TLS handshaking: SSL_accept() failed: error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol, session=<xog4Kvrys92saZPl>
Jan 24 12:18:13 vps.marketingmore.in systemd[1]: Stopping Dovecot IMAP/POP3 email server...
Jan 24 12:18:13 vps.marketingmore.in dovecot[642252]: master: Warning: Killed with signal 15 (by pid=533048 uid=0 code=kill)
Jan 24 12:18:14 vps.marketingmore.in systemd[1]: Stopped Dovecot IMAP/POP3 email server`.
Email Server Login Error
Tried to login to cyberpanel email but it shows this error
one of my friend told me to check the server with this command systemctl status dovecot -l
and it shows that dovecot.service failed
give me some solutions why this is happening
thanks

Found The Solution
its the mail server ssl issue.
Run rm -rf /etc/letsencrypt/live/mail.mydomain.com to remove all mail certificates
Run nano /etc/dovecot/dovecot.conf to remove mail certificate directive
local_name mail.mydomain.com { ssl_cert = </etc/letsencrypt/live/mail.mydomain.com/fullchain.pem ssl_key = </etc/letsencrypt/live/mail.mydomain.com/privkey.pem }
Then run systemctl restart dovecot && systemctl status dovecot

Related

php7.4-fpm fails to start - update PHP 7.3 to PHP 7.4 on VULTR Ubuntu 18.04 with nginx

I just tried to update the PHP Version of the nginx server and I get this message, when I enter systemctl status php7.4-fpm.service
php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-12-14 20:11:31 UTC; 4min 50s ago
Docs: man:php-fpm7.4(8)
Process: 9196 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
Process: 9178 ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf (code=exited, status=78)
Main PID: 9178 (code=exited, status=78)
Dec 14 20:11:31 vultr.guest systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Dec 14 20:11:31 vultr.guest php-fpm7.4[9178]: [14-Dec-2020 20:11:31] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (98)
Dec 14 20:11:31 vultr.guest php-fpm7.4[9178]: [14-Dec-2020 20:11:31] ERROR: FPM initialization failed
Dec 14 20:11:31 vultr.guest systemd[1]: php7.4-fpm.service: Main process exited, code=exited, status=78/n/a
Dec 14 20:11:31 vultr.guest systemd[1]: php7.4-fpm.service: Failed with result 'exit-code'.
Dec 14 20:11:31 vultr.guest systemd[1]: Failed to start The PHP 7.4 FastCGI Process Manager.
Also if I check for the Version with php -v I get back the Version 7.4.13
However, if upload a test.php File with just <?php phpinfo();?> in it, the Server tells me that I still run on PHP Version 7.3.22-1+ubuntu18.04.1+deb.sury.org+1
Already tried to change the standard PHP version with sudo update-alternatives --set php /usr/bin/php7.4
Thanks for your help

MySQL service doesn't start on Ubuntu 14.04 after upgrading PHP from version 5.6 to 7.2

I have upgraded my PHP from version 5.6 to 7.2 and now MySQL does not work. When I enter sudo service mysqsl start, the following text gets displayed:
Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
output of journalctl -xe
output of systemctl status mysql.service:
mysql.service - LSB: Start and stop the mysql database server daemon
Loaded: loaded (/etc/init.d/mysql)
Active: failed (Result: exit-code) since \u0633\u0647\u200c\u0634\u0646\u0628\u0647 2018-07-17 04:22:01 +0430; 27s ago
Docs: man:systemd-sysv-generator(8)
Process: 26938 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 6860 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
Main PID: 9974 (code=exited, status=0/SUCCESS)
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine mysql[6860]: [97B blob data]
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine mysql[6860]: Fatal error in defaults handling. Program aborted
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine /etc/init.d/mysql[7565]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine /etc/init.d/mysql[7565]: [61B blob data]
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine /etc/init.d/mysql[7565]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine mysql[6860]: ...fail!
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: mysql.service: Control process exited, code=exited status=1
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: mysql.service: Unit entered failed state.
\u0698\u0648\u0626\u06cc\u0647 17 04:22:01 hutadmin-virtual-machine systemd[1]: mysql.service: Failed with result 'exit-code'.
How can I fix this problem? I need to start MySQL.

cannot connect to MySQL server (HY000/2002) [duplicate]

This question already has answers here:
mysqli_real_connect(): (HY000/2002): No such file or directory
(19 answers)
Closed 5 months ago.
I get this error when I try to login in phpmyadmin: "mysqli_real_connect(): no such file or directory"
My os is ubuntu
What should I do?
I even do this
"change localhost to 127.0.0.1 in config.inc.php"
but it doesn't work
this is the status of MySQL service
`sudo service mysql status`
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en)
Active: failed (Result: exit-code) since Sat 2018-05-19 08:54:24 CST; 2min 4s
Process: 31984 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exi
Main PID: 1244 (code=exited, status=0/SUCCESS)
مه 19 08:54:24 amir systemd[1]: mysql.service: Service hold-off time over, sched
مه 19 08:54:24 amir systemd[1]: mysql.service: Scheduled restart job, restart co
مه 19 08:54:24 amir systemd[1]: Stopped MySQL Community Server.
مه 19 08:54:24 amir systemd[1]: mysql.service: Start request repeated too quickl
مه 19 08:54:24 amir systemd[1]: mysql.service: Failed with result 'exit-code'.
مه 19 08:54:24 amir systemd[1]: Failed to start MySQL Community Server.
Seen that you changed in config.inc.php:
localhost to 127.0.0.1
Well you could try not doing it by just adding the port-number where the mysql runs like in the example below:
$cfg['Servers'][$i]['host'] = 'localhost:3306';
Actually, I too had same problem and tried as you did which is ultimately answered everywhere in different forums.
Finally, I tried the above and worked for me. hopefully, it does work for you as well.
Good luck!

Apache2 is not working

I use Linux Mint. When I try to restart apache displays next message. Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details. Here the next error tex that displays systemctl status `apache2.service
:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2018-05-31 14:15:00 EEST; 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 20286 ExecStart=/etc/init.d/apache2 start (code=exited, status=2)
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Starting LSB: Apache2 web server...
May 31 14:15:00 alpha-To-be-filled-by-O-E-M apache2[20286]: ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Control process exited, code=exited status=2
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Failed to start LSB: Apache2 web server.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Unit entered failed state.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Failed with result 'exit-code'.
And here what display journalctl -xe
`enter code here`--
-- Unit flatpak-system-helper.service has begun starting up.
May 31 14:11:23 alpha-To-be-filled-by-O-E-M dbus[923]: [system] Successfully activated service 'org.freedesktop.Flatpak.SystemHelper'
May 31 14:11:23 alpha-To-be-filled-by-O-E-M systemd[1]: Started flatpak system helper.
-- Subject: Unit flatpak-system-helper.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit flatpak-system-helper.service has finished starting up.
--
-- The start-up result is done.
May 31 14:11:25 alpha-To-be-filled-by-O-E-M ll[18688]: libostree pull from 'flathub' for appstream/x86_64 complete
security: GPG: summary+commit http: TLS
non-delta: meta: 1 content: 0
transfer: secs: 1 size: 569 bytes
May 31 14:11:26 alpha-To-be-filled-by-O-E-M flatpak-system-helper[18716]: libostree pull from 'flathub' for appstream/x86_64 complete
security: GPG: summary+commit
non-delta: meta: 1 content: 0
transfer: secs: 0 size: 569 bytes
May 31 14:11:34 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=62651 PROTO=2
May 31 14:13:40 alpha-To-be-filled-by-O-E-M sudo[18962]: alpha : TTY=pts/0 ; PWD=/home/alpha ; USER=root ; COMMAND=/usr/bin/apt-get install lamp-server^ -y
May 31 14:13:40 alpha-To-be-filled-by-O-E-M sudo[18962]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 31 14:13:42 alpha-To-be-filled-by-O-E-M sudo[18962]: pam_unix(sudo:session): session closed for user root
May 31 14:14:35 alpha-To-be-filled-by-O-E-M sudo[20275]: alpha : TTY=pts/0 ; PWD=/home/alpha ; USER=root ; COMMAND=/bin/nano /var/www/testing.php
May 31 14:14:35 alpha-To-be-filled-by-O-E-M sudo[20275]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 31 14:14:39 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=36473 PROTO=2
May 31 14:14:44 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:48:43:7c:bd:86:85:08:00 SRC=192.168.88.21 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=54328 PROTO=2
May 31 14:14:49 alpha-To-be-filled-by-O-E-M sudo[20275]: pam_unix(sudo:session): session closed for user root
May 31 14:15:00 alpha-To-be-filled-by-O-E-M sudo[20280]: alpha : TTY=pts/0 ; PWD=/home/alpha ; USER=root ; COMMAND=/usr/sbin/service apache2 restart
May 31 14:15:00 alpha-To-be-filled-by-O-E-M sudo[20280]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Stopped LSB: Apache2 web server.
-- Subject: Unit apache2.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has finished shutting down.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Starting LSB: Apache2 web server...
-- Subject: Unit apache2.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M apache2[20286]: ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Control process exited, code=exited status=2
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Unit entered failed state.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M systemd[1]: apache2.service: Failed with result 'exit-code'.
May 31 14:15:00 alpha-To-be-filled-by-O-E-M sudo[20280]: pam_unix(sudo:session): session closed for user root
May 31 14:15:29 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=8118 PROTO=2
May 31 14:15:37 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:74:1b:b2:78:93:ac:08:00 SRC=192.168.88.25 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=10819 PROTO=2
May 31 14:17:01 alpha-To-be-filled-by-O-E-M CRON[20404]: pam_unix(cron:session): session opened for user root by (uid=0)
May 31 14:17:01 alpha-To-be-filled-by-O-E-M CRON[20405]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 31 14:17:01 alpha-To-be-filled-by-O-E-M CRON[20404]: pam_unix(cron:session): session closed for user root
May 31 14:17:18 alpha-To-be-filled-by-O-E-M kernel: [UFW BLOCK] IN=enp2s0 OUT= MAC=01:00:5e:00:00:fb:48:43:7c:bd:86:85:08:00 SRC=192.168.88.21 DST=224.0.0.251 LEN=32 TOS=0x00 PREC=0x00 TTL=1 ID=37441 PROTO=2
May 31 14:17:33 alpha-To-be-filled-by-O-E-M AptDaemon[18313]: INFO: Quitting due to inactivity
May 31 14:17:33 alpha-To-be-filled-by-O-E-M AptDaemon[18313]: INFO: Quitting was requested
May 31 14:17:33 alpha-To-be-filled-by-O-E-M org.debian.apt[923]: 14:17:33 AptDaemon [INFO]: Quitting due to inactivity
May 31 14:17:33 alpha-To-be-filled-by-O-E-M org.debian.apt[923]: 14:17:33 AptDaemon [INFO]: Quitting was requested
After I have removed and reinstalled apache2 shows next message:
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead) since Thu 2018-05-31 14:40:49 EEST; 1min 35s ago
Docs: man:systemd-sysv-generator(8)
Process: 24002 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 23986 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: no listening sockets available, shutting down
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: AH00015: Unable to open logs
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: Action 'start' failed.
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: The Apache error log may have more information.
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: *
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[24002]: * Stopping Apache httpd web server apache2
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[24002]: *
May 31 14:40:49 alpha-To-be-filled-by-O-E-M systemd[1]: Started LSB: Apache2 web server.
In the log it is shown that port 80 (of apache2 is used by another application):-
May 31 14:40:49 alpha-To-be-filled-by-O-E-M apache2[23986]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
To resolve this stop the existing running application and try to start apache2.
To check the running application on port 80:-
sudo lsof -i:80
Take the pid of the running application and kill the application using below command:-
sudo pkill -9 <pid of running application>
Run the apache2 application again:-
sudo service apache2 start
export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
Add this line in your /etc/apache2/envvars file
if there is no suffix then you have to add
#for supporting multiple apache2 instances
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
else
SUFFIX=
fi
UPDATE
no listening sockets available. You are facing this issue because another application/service acquired port 80 on your Ubuntu Server.
Now you need to Kill the process which acquired port 80. You can find that easily with following command :-
sudo netstat -ltnp | grep ':80'
This will return something like :-
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 1588/aolserver4-nsd
for above case Process number 1588 acquired port 80 , you need to kill that process 1588.
sudo kill -9 1588
Now you can start your apache
Solution 2
go to /etc/apache2/ports.conf and uncomment Listen 80
**If your Apache2 is not working and it returns like this **
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2021-02-12 11:23:47 PST; 2min 57s ago
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: AH00558: apache2: Could not reliably determine the server's fully qu
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: (98)Address already in use: AH00072: make_sock: could not bind to ad
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: (98)Address already in use: AH00072: make_sock: could not bind to ad
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: no listening sockets available, shutting down
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: AH00015: Unable to open logs
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: Action 'start' failed.
Feb 12 11:23:47 bitcot-Latitude-7480 apachectl[9660]: The Apache error log may have more information.
Feb 12 11:23:47 bitcot-Latitude-7480 systemd[1]: apache2.service: Control process exited, code=exited status=1
Feb 12 11:23:47 bitcot-Latitude-7480 systemd[1]: apache2.service: Failed with result 'exit-code'.
Feb 12 11:23:47 bitcot-Latitude-7480 systemd[1]: Failed to start The Apache HTTP Server.
don't worry I have a solution for you
firstly check-in your machine is there Nginx service is running in your system using
sudo systemctl status nginx.service
if it is running stop the service using
sudo systemctl stop nginx.service
and then check port 80 is there any process running on that port using
sudo lsof -i tcp:80
output:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
anydesk 950 root 22u IPv4 39398 0t0 TCP bitcot-Latitude-7480:35993->hosted.by.datacamp.co.uk:http (ESTABLISHED)
kill the process using
sudo kill 950
Now your apache2 is ready, To start service open a new terminal Ctrl + Ail + T and start service using
sudo systemctl start apache2
here you go

PHP Thread compilation not working

I am attempting to use pthreads with Apache FPM.
Step 1.
After installing and recompiling php according to:
https://blog.programster.org/ubuntu16-04-compile-php-7-2-with-pthreads
The server works as expected and I can run pthreads from CLI.
Step 2.
Then I need to run threads from a web server so I followed the instructions from:
https://antrecu.com/blog/run-php7-fpm-apache-mpmevent-ubuntu-1604
After sudo service apache2 restart && sudo service php7.0-fpm restart:
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
$ systemctl status apache2.service
apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Mon 2018-03-12 17:09:45 PDT; 3min 35s ago
Docs: man:systemd-sysv-generator(8)
Process: 30818 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 32443 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
Mar 12 17:09:45 ubuntu apache2[32443]: * The apache2 configtest failed.
Mar 12 17:09:45 ubuntu apache2[32443]: Output of config test was:
Mar 12 17:09:45 ubuntu apache2[32443]: [Mon Mar 12 17:09:45.084452 2018] [:crit] [pid 32454:tid 139629110323072]
Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You n.. (output cut off in SSH client)
Mar 12 17:09:45 ubuntu apache2[32443]: AH00013: Pre-configuration failed
Mar 12 17:09:45 ubuntu apache2[32443]: Action 'configtest' failed.
Mar 12 17:09:45 ubuntu apache2[32443]: The Apache error log may have more information.
Mar 12 17:09:45 ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Mar 12 17:09:45 ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
Mar 12 17:09:45 ubuntu systemd[1]: apache2.service: Unit entered failed state.
Needless to say I am a newbie when it comes to compiling Linux packages.
Any suggestions?
I am attempting to use pthreads with Apache FPM.
You can't. Find a way to work without them.
The pthreads extension cannot be used in a web server environment. Threading in PHP is therefore restricted to CLI-based applications only.
-- http://php.net/manual/en/intro.pthreads.php

Categories