저는 php7.4-fpm을 사용하여 Ubuntu 서버 20.04에서 LAMP를 실행하고 있습니다.
방금 최신 업데이트/업그레이드를 수행했고 모든 것이 제대로 작동하는지 확인했습니다.
● 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: active (running) since Fri 2022-08-26 00:50:45 CST; 7min ago
Docs: man:php-fpm7.4(8)
Main PID: 120871 (php-fpm7.4)
Status: "Processes active: 0, idle: 2, Requests: 24, slow: 0, Traffic: 0.1req/sec"
Tasks: 3 (limit: 4380)
Memory: 80.8M
CGroup: /system.slice/php7.4-fpm.service
├─120871 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
├─120892 php-fpm: pool www
└─120893 php-fpm: pool www
그리고 몇 분 후... Nextcloud 설치가 갑자기 동기화를 중단하여 php-fpm 상태를 다시 확인했고 다음과 같은 결과를 얻었습니다.
● php7.4-fpm.service
Loaded: masked (Reason: Unit php7.4-fpm.service is masked.)
Active: inactive (dead) since Fri 2022-08-26 01:07:14 CST; 5min ago
Main PID: 120871 (code=exited, status=0/SUCCESS)
Status: "Processes active: 0, idle: 2, Requests: 44, slow: 0, Traffic: 0req/sec"
Aug 26 01:07:14 admin.example.com systemd[1]: Stopping The PHP 7.4 FastCGI Process Manager...
Aug 26 01:07:14 admin.example.com systemd[1]: php7.4-fpm.service: Succeeded.
Aug 26 01:07:14 admin.example.com systemd[1]: Stopped The PHP 7.4 FastCGI Process Manager.
Warning: journal has been rotated since unit was started, output may be incomplete.`
그리고 말 그대로 /lib/systemd/system/php7.4-fpm.service
더 이상 존재하지 않습니다.
# stat /lib/systemd/system/php7.4-fpm.service
stat: cannot stat '/lib/systemd/system/php7.4-fpm.service': No such file or directory
타임스탬프를 기준으로 서비스를 차단하면 어떤 일이 발생하는지 확인했습니다 syslog
. 로그에는 무슨 일이 일어나고 있는지 설명할 내용이 없습니다.
Aug 26 01:07:14 admin systemd[1]: Stopped The PHP 7.4 FastCGI Process Manager.
Aug 26 01:07:14 admin systemd[1]: php7.4-fpm.service: Succeeded.
Aug 26 01:07:14 admin systemd[1]: Stopping The PHP 7.4 FastCGI Process Manager...
Aug 26 01:07:14 admin systemd[1]: Configuration file /etc/systemd/system/gitea.service is marked world-inaccessible. This has no effect as configuration data is accessible via APIs without restrictions. Proceeding anyway.
Aug 26 01:07:14 admin systemd[1]: Reloading.
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module readline for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module pspell for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module ctype for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module redis for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module dom for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module soap for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module iconv for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module apcu_bc for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module phar for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module mysqlnd for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module imap for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module xsl for PHP 7.4 fpm sapi
Aug 26 01:07:14 admin php7.4-fpm: php_invoke prerm: Disabled module sysvshm for PHP 7.4 fpm sapi
이 문제를 해결하기 위해 시도한 것:
php7.4-fpm을 사용하여 암호를 해독하려고 하면 systemctl unmask php7.4-fpm
두 가지 일이 발생합니다.
/etc/systemd/system/php7.4-fpm.service
제거됨./etc/systemd/system/php7.4-fpm.service
/dev/null에 대한 심볼릭 링크입니다.php7.4-fpm.service가 사용되기 시작합니다.
init.d
● php7.4-fpm.service - LSB: starts php7.4-fpm
Loaded: loaded (/etc/init.d/php7.4-fpm; generated)
Active: active (exited) since Fri 2022-08-26 09:09:10 CST; 6min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 4380)
Memory: 0B
CGroup: /system.slice/php7.4-fpm.service
apt-get install --reinstall php7.4-fpm
다음을 사용하여 php7.4fpm을 다시 설치하려고 하면
root@admin:~# apt-get install --reinstall php7.4-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php7.4-fpm : Depends: php7.4-common (= 7.4.3-4ubuntu2.12) but 7.4.3-4ubuntu2.13 is to be installed
E: Unable to correct problems, you have held broken packages.
위의 모든 단계는 다음 문서를 기반으로 합니다. https://askubuntu.com/questions/804946/systemctl-how-to-unmask
현재 손상된 패키지로 인해 갇혀 있습니다.
예, 시도해 보았습니다.
apt install -f
dpkg --configure -a
도움이 되지 않습니다. PHP를 다시 설치하는 방법을 아는 사람이 있습니까?
답변1
이 문제는 근본적으로 업스트림 우분투 저장소의 패키징 문제인 것으로 보이며 관리자가 이를 해결하는 데 다소 시간이 걸릴 수 있습니다.
The following packages have unmet dependencies:
php7.4-fpm : Depends: php7.4-common (= 7.4.3-4ubuntu2.12) but 7.4.3-4ubuntu2.13 is to be installed
E: Unable to correct problems, you have held broken packages.
그동안 이 문제에 대한 유일한 해결책은 다음과 같습니다.-앞으로-최신 PHP 업데이트를 수행합니다. 컴퓨터에 다음 저장소가 설치되어 있는지 확인하세요.
sudo add-apt-repository ppa:ondrej/php
업데이트하기 전에 이 저장소를 설치하면 위의 악몽을 피할 수 있습니다.