Instalace PHP 5 na Debian Jessie

Instalace PHP 5 na Debian Jessie
« kdy: 27. 11. 2018, 20:43:46 »
Potreboval by som nainstalovat (na LXC debian-8.0-standard_8.7-1_amd64) php 5.(6)
Po instalacii apache a maiadb instalujem php
Kód: [Vybrat]
apt-get -y install php5 libapache2-mod-php5ale pri reloade apache to hodi failed.
Cely log instalacie php
Kód: [Vybrat]
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libonig2 libqdbm14 php5-cli php5-common php5-json php5-readline
Suggested packages:
  php-pear php5-user-cache
The following NEW packages will be installed:
  libapache2-mod-php5 libonig2 libqdbm14 php5 php5-cli php5-common php5-json php5-readline
0 upgraded, 8 newly installed, 0 to remove and 2 not upgraded.
Need to get 5,437 kB of archives.
After this operation, 21.5 MB of additional disk space will be used.
Get:1 http://ftp.debian.org/debian/ jessie/main libonig2 amd64 5.9.5-3.2+deb8u1 [117 kB]
Get:2 http://security.debian.org/ jessie/updates/main php5-common amd64 5.6.38+dfsg-0+deb8u1 [743 kB]
Get:3 http://ftp.debian.org/debian/ jessie/main libqdbm14 amd64 1.8.78-5+b1 [118 kB]
Get:4 http://ftp.debian.org/debian/ jessie/main php5-json amd64 1.3.6-1 [18.6 kB]
Get:5 http://security.debian.org/ jessie/updates/main php5-cli amd64 5.6.38+dfsg-0+deb8u1 [2,199 kB]
Get:6 http://security.debian.org/ jessie/updates/main libapache2-mod-php5 amd64 5.6.38+dfsg-0+deb8u1 [2,227 kB]
Get:7 http://security.debian.org/ jessie/updates/main php5 all 5.6.38+dfsg-0+deb8u1 [1,304 B]
Get:8 http://security.debian.org/ jessie/updates/main php5-readline amd64 5.6.38+dfsg-0+deb8u1 [12.7 kB]
Fetched 5,437 kB in 2s (2,480 kB/s)
Selecting previously unselected package libonig2:amd64.
(Reading database ... 21856 files and directories currently installed.)
Preparing to unpack .../libonig2_5.9.5-3.2+deb8u1_amd64.deb ...
Unpacking libonig2:amd64 (5.9.5-3.2+deb8u1) ...
Selecting previously unselected package libqdbm14.
Preparing to unpack .../libqdbm14_1.8.78-5+b1_amd64.deb ...
Unpacking libqdbm14 (1.8.78-5+b1) ...
Selecting previously unselected package php5-common.
Preparing to unpack .../php5-common_5.6.38+dfsg-0+deb8u1_amd64.deb ...
Unpacking php5-common (5.6.38+dfsg-0+deb8u1) ...
Selecting previously unselected package php5-json.
Preparing to unpack .../php5-json_1.3.6-1_amd64.deb ...
Unpacking php5-json (1.3.6-1) ...
Selecting previously unselected package php5-cli.
Preparing to unpack .../php5-cli_5.6.38+dfsg-0+deb8u1_amd64.deb ...
Unpacking php5-cli (5.6.38+dfsg-0+deb8u1) ...
Selecting previously unselected package libapache2-mod-php5.
Preparing to unpack .../libapache2-mod-php5_5.6.38+dfsg-0+deb8u1_amd64.deb ...
Unpacking libapache2-mod-php5 (5.6.38+dfsg-0+deb8u1) ...
Selecting previously unselected package php5.
Preparing to unpack .../php5_5.6.38+dfsg-0+deb8u1_all.deb ...
Unpacking php5 (5.6.38+dfsg-0+deb8u1) ...
Selecting previously unselected package php5-readline.
Preparing to unpack .../php5-readline_5.6.38+dfsg-0+deb8u1_amd64.deb ...
Unpacking php5-readline (5.6.38+dfsg-0+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up libonig2:amd64 (5.9.5-3.2+deb8u1) ...
Setting up libqdbm14 (1.8.78-5+b1) ...
Setting up php5-common (5.6.38+dfsg-0+deb8u1) ...

Creating config file /etc/php5/mods-available/pdo.ini with new version
php5_invoke: Enable module pdo for apache2 SAPI
php5_invoke: Enable module pdo for cli SAPI

Creating config file /etc/php5/mods-available/opcache.ini with new version
php5_invoke: Enable module opcache for apache2 SAPI
php5_invoke: Enable module opcache for cli SAPI
Setting up php5-json (1.3.6-1) ...
php5_invoke: Enable module json for apache2 SAPI
php5_invoke: Enable module json for cli SAPI
Setting up php5-cli (5.6.38+dfsg-0+deb8u1) ...
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar5 to provide /usr/bin/phar (phar) in auto mode

Creating config file /etc/php5/cli/php.ini with new version
Setting up libapache2-mod-php5 (5.6.38+dfsg-0+deb8u1) ...

Creating config file /etc/php5/apache2/php.ini with new version
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
[FAIL] Restarting web server: apache2 failed!
invoke-rc.d: initscript apache2, action "restart" failed.
apache2_invoke: Enable module php5
[FAIL] Restarting web server: apache2 failed!
invoke-rc.d: initscript apache2, action "restart" failed.
Setting up php5 (5.6.38+dfsg-0+deb8u1) ...
Setting up php5-readline (5.6.38+dfsg-0+deb8u1) ...

Creating config file /etc/php5/mods-available/readline.ini with new version
php5_invoke: Enable module readline for apache2 SAPI
php5_invoke: Enable module readline for cli SAPI
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Processing triggers for libapache2-mod-php5 (5.6.38+dfsg-0+deb8u1) ...
google mi nejak nechce pomoct.
« Poslední změna: 27. 11. 2018, 21:49:14 od Petr Krčmář »


Jenda

Re:Instalacia php5 na jessie
« Odpověď #1 kdy: 27. 11. 2018, 21:15:55 »
Pokud je tam systemd, tak systemctl status apachí_unita příp. journalctl -něco (když se tu unitu pokusíš spustit, tak ti to řekne). Pokud tam je sysv init, tak bash -x /etc/init.d/apache2 start.

Re:Instalace PHP 5 na Debian Jessie
« Odpověď #2 kdy: 27. 11. 2018, 22:03:58 »
Ide to na proxmox 5.2-10 cize hostitel je systemd, tak aj kontajner bezi zo systemd. No problem je uz pri instalacii php, vid log na konci kedy ma problem uz instalacny skript restartovat apache.
Neviem ako by to bolo s instalaciou php 7.x, ale to som ani neskusal, lebo potrebujem php 5.

ByCzech

  • *****
  • 1 870
    • Zobrazit profil
    • E-mail
Re:Instalace PHP 5 na Debian Jessie
« Odpověď #3 kdy: 27. 11. 2018, 22:34:15 »
Problém vidím nejspíš tady:

Kód: [Vybrat]
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
[FAIL] Restarting web server: apache2 failed!

Buď není prefork nainstalovaný https://packages.debian.org/jessie/apache2-mpm-prefork nebo je v konfiguraci apache něco, co je závislé na mpm event a po zapnutí prefork to držkuje.

Řešením je doinstalovat mpm prefork a/nebo upravit konfiguraci apache pro mpm prefork a nebo používat PHP v apache s mpm event přes Fast Process Manager https://packages.debian.org/jessie/php5-fpm

kekme

Re:Instalace PHP 5 na Debian Jessie
« Odpověď #4 kdy: 27. 11. 2018, 23:33:03 »
A nebo se vysrat na LXD, hodit to do Dockeru a použít php7.0+nginx+fpm  :p


Re:Instalace PHP 5 na Debian Jessie
« Odpověď #5 kdy: 27. 11. 2018, 23:58:13 »
jednoznacne FPM
Děkuji za možnost editace příspěvku.

Re:Instalace PHP 5 na Debian Jessie
« Odpověď #6 kdy: 28. 11. 2018, 10:47:36 »
A nebo se vysrat na LXD, hodit to do Dockeru a použít php7.0+nginx+fpm  :p
https://forum.root.cz/index.php?topic=20168.msg297041#msg297041

M.K.

Re:Instalace PHP 5 na Debian Jessie
« Odpověď #7 kdy: 28. 11. 2018, 11:43:46 »
Nebo oldschool:

Kód: [Vybrat]
apt-get install -y wget bzip2 gcc libxml2-dev libz-dev libbz2-dev libcurl4-openssl-dev libmcrypt-dev libpq-dev libxslt-dev && \
wget http://cz1.php.net/get/php-5.6.38.tar.bz2/from/this/mirror -O php-5.6.38.tar.bz2 && \
tar jxf ./php-5.6.38.tar.bz2 && \
cd php-5.6.38 && ./configure --prefix=/opt/php-5.6 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-fpm