Как поставить PECL uploadprogress на Ubuntu + nginx ?

Главные вкладки

Аватар пользователя VasyOK VasyOK 21 июня в 16:29

Ubuntu 24 + Ngignx + php 8.2
Устанавливаю PECL uploadprogress.

apt-get install php8.2-uploadprogress

пишет:

NOTICE: You are seeing this message because you have apache2 package installed.
Processing triggers for php8.3-cli (8.3.8-2+ubuntu24.04.1+deb.sury.org+1) ...
Processing triggers for libapache2-mod-php8.3 (8.3.8-2+ubuntu24.04.1+deb.sury.org+1) ...
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
× apache2.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2024-06-18 17:36:01 MSK; 14ms ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 10867 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 26ms

Jun 18 17:36:01 my-server.com systemd[1]: Starting apache2.service - The Apache HTTP Server...
Jun 18 17:36:01 my-server.com apachectl[10869]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jun 18 17:36:01 my-server.com apachectl[10869]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jun 18 17:36:01 my-server.com apachectl[10869]: no listening sockets available, shutting down
Jun 18 17:36:01 my-server.com apachectl[10869]: AH00015: Unable to open logs
Jun 18 17:36:01 my-server.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jun 18 17:36:01 my-server.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 18 17:36:01 my-server.com systemd[1]: Failed to start apache2.service - The Apache HTTP Server.

После этого в отчет о состоянии вижу:
Upload progress Enabled (PECL uploadprogress)

К сожалению после этого composer не может ничего поставить, т.к. после установки в консоли используется почему-то версия php 8.3., не 8.2.

Пробовал еще так:
https://eureka.ykyuen.info/2013/02/15/ubuntu-install-pecl-uploadprogress...
но тоже не получается.

Комментарии

Аватар пользователя VasyOK VasyOK 23 июня в 13:54

apt remove libapache2-mod-php8.3
выдает:

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
× apache2.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2024-06-23 13:46:40 MSK; 15ms ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 40549 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 17ms

Jun 23 13:46:40 my-server.com systemd[1]: Starting apache2.service - The Apache HTTP Server...
Jun 23 13:46:40 my-server.com apachectl[40551]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jun 23 13:46:40 my-server.com apachectl[40551]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jun 23 13:46:40 my-server.com apachectl[40551]: no listening sockets available, shutting down
Jun 23 13:46:40 my-server.com apachectl[40551]: AH00015: Unable to open logs
Jun 23 13:46:40 my-server.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jun 23 13:46:40 my-server.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 23 13:46:40 my-server.com systemd[1]: Failed to start apache2.service - The Apache HTTP Server.

apt install libapache2-mod-php8.2

выдает:

Jun 23 13:48:21 my-server.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jun 23 13:48:21 my-server.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 23 13:48:21 my-server.com systemd[1]: Failed to start apache2.service - The Apache HTTP Server.
Processing triggers for libapache2-mod-php8.2 (8.2.20-2+ubuntu24.04.1+deb.sury.org+1) ...
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
× apache2.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sun 2024-06-23 13:48:21 MSK; 16ms ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 42259 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 24ms

Jun 23 13:48:21 my-server.com systemd[1]: Starting apache2.service - The Apache HTTP Server...
Jun 23 13:48:21 my-server.com apachectl[42261]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jun 23 13:48:21 my-server.com apachectl[42261]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jun 23 13:48:21 my-server.com apachectl[42261]: no listening sockets available, shutting down
Jun 23 13:48:21 my-server.com apachectl[42261]: AH00015: Unable to open logs
Jun 23 13:48:21 my-server.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Jun 23 13:48:21 my-server.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Jun 23 13:48:21 my-server.com systemd[1]: Failed to start apache2.service - The Apache HTTP Server.

После этого:

php -v
PHP 8.3.8

Все тоже самое. После этих дейстивий не хочет композер ставить модули.
Может для nginx это надо как-то по другому ставить чем для апача?

Аватар пользователя jura12 jura12 23 июня в 14:06

сначала останови апачи
systemctl stop apache2
apt remove libapache2-mod-php8.3
apt install libapache2-mod-php8.2
sudo update-alternatives —config php
выбери php8.2
systemctl start apache2
что после этого?

Аватар пользователя VasyOK VasyOK 23 июня в 14:59

Юрий, спасибо. Ты прав.

Но я не понимаю, почему установка библиотеки
apt-get install php8.2-uploadprogress
устанавливает дополнительный веб сервер, который надо стопить.

А зачем его запускать т.е. systemctl start apache2 ?

Аватар пользователя VasyOK VasyOK 25 июня в 7:40

Еще один момент. После установки uploadprogress и останова apache2 сайт становится какой-то неповоротливый в админке.

Аватар пользователя jura12 jura12 25 июня в 12:00

я вообще не знаю когда uploadprogress срабатывает. возможно неповоротливый по другой причине. uploadprogress как видно будет работать при загрузке файлов. попробуйте обновить кэш.