[WORKAROUND] Mageia 8 & PHP7

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

[WORKAROUND] Mageia 8 & PHP7

Postby rtl19 » Mar 30th, '21, 03:49

I made a big mistake. I did a fresh install on my server without realizing mageia 8 only comes with PHP8 until it was too late. I know this is a long shot but is there an easy way to get PHP7 on my Mageia 8 server?

Thanks!
R
Last edited by doktor5000 on Apr 9th, '21, 17:03, edited 1 time in total.
Reason: adjusted thread title
rtl19
 
Posts: 10
Joined: Mar 6th, '21, 22:06

Re: Mageia 8 & Php - I messed up

Postby doktor5000 » Mar 30th, '21, 18:12

Not really, no. Easiest way would probably be to try to rebuild the mga7 src.rpms yourself or try to install them, but I don't think that's a good idea (and overall it's also not easy at all).
Also have a look at https://wiki.mageia.org/en/Mageia_8_Errata#PHP7_dropped
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16797
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mageia 8 & Php - I messed up

Postby rtl19 » Mar 31st, '21, 16:48

Thanks for the info. I'll look into what's involved with building PHP7 myself.
rtl19
 
Posts: 10
Joined: Mar 6th, '21, 22:06

Re: Mageia 8 & Php - I messed up

Postby rtl19 » Apr 2nd, '21, 02:02

I'm happy to say I got php7 working on my Mageia 8. It wasn't pretty :) I wouldn't consider the level of effort to be signifcant, however.

Off the top of my head, this is what I did:
    * Download the php 7 tarball off the php site
    * installed apache-devel
    * set the prefix in the php7 configure to /opt/php7 (this makes it easy to remove later)
    * activate php configure modules - I took this list of modules from php8 that comes with Mageia
    * Compiled php7
    * installed to /opt/php7
    * ln -s /opt/php7/lib/php/extensions/libphp7.so /usr/lib64/httpd/modules/mod_php.so
    * put my old php.ini in /etc
    * put /etc/modules.d/70_mod_php.conf out there from my backed up php 7 version. I had to tweak this ever so slightly

I'm sure there are a few more minor tweaks/steps. I'm happy to say the 3 php applications I needed to work are in fact working. If anyone needs more detail, please let me know and I'll dig around in my notes.

By the way, these are the specific ./configure options I used to build php7:
Code: Select all
./configure --prefix /opt/php7 --with-curl --enable-exif --enable-ftp --enable-gd --with-gettext --enable-mbstring --with-mysqli --enable-mysqlnd --with-openssl --enable-phpdbg-webhelper --enable-sockets --enable-sysvsem --enable-sysvshm -with-zlib --with-apxs2 --with-mysql-sock


R
rtl19
 
Posts: 10
Joined: Mar 6th, '21, 22:06

Re: Mageia 8 & Php - I messed up

Postby filip » Apr 2nd, '21, 10:40

Hi, R.!
Glad that you make it. And thanks for sharing your procedure! I hope you can soon start to port your php7 apps up to 8.

I can relate to that as I still need to update 2 websites ;). After that (soon I hope) I'll shift my production desktop to mga8 too. I successfully setup RPI4 4G already with mga8 used as a file backup server for Desktop and Sailfish phone, apache server to test my webites, share mga torrents and to browse now and then on TV as it has way obsolete Chrome 22 there (you can imagine easily that almost no website works with that: hint SSL is not supported). It works great but I still need to fix two major functions (sound and pigpio).
filip
 
Posts: 456
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia

Re: Mageia 8 & Php - I messed up

Postby morgano » Apr 2nd, '21, 12:18

Many thanks :)
I now linked this thread from https://wiki.mageia.org/en/Mageia_8_Errata#PHP7_dropped .
Mandriva since 2006, then Mageia since 2011 at home & work. Thinkpad T43 & T400, Dell M4400, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 812
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: Mageia 8 & Php - I messed up

Postby rtl19 » Apr 2nd, '21, 15:47

@morgano, since this thread is being linked from the wiki, I'll post a more detailed set of steps sometime this weekend.

@filip, that's so cool! We have a few raspberry pi's. They're so much fun to play with. I have 2 pi 3's. One is used as a mythtv frontend and pi-hole, the other is used to display a slideshow of pictures on a wall TV and sometimes run kodi as well. Then I have a pi zero w that we use to open/close the garage door. It never fails that I leave the house and ask myself, did I close the garage door. This gives me peace of mind. :) The two webapps I use that need php7 are mythweb and piwigo photo gallery. I'm fairly certain piwigo will be made compatable with php8 at some point but mythweb probably never will.

R
rtl19
 
Posts: 10
Joined: Mar 6th, '21, 22:06

Re: Mageia 8 & Php - I messed up

Postby morgano » Apr 3rd, '21, 00:15

@rtl19, that would be awsome.
It would be best as a wiki page.
So if you like to try, here is a starting hint: https://wiki.mageia.org/en/How_to_write_a_wiki_page

Also see this thread: https://ml.mageia.org/l/arc/dev/2021-03/msg00018.html
So you may like to join dev mailing list and discuss. Maybe by joint effort package it.
Mandriva since 2006, then Mageia since 2011 at home & work. Thinkpad T43 & T400, Dell M4400, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 812
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: Mageia 8 & Php - I messed up

Postby filip » Apr 3rd, '21, 16:03

@rtl19
Yeah. RPI are really nice. I'll try to create some docs for install and use. Eventually. Soon ;).
I saw https://www.mythtv.org/wiki/Build_from_Source for mythweb. Don't know if it helps.
filip
 
Posts: 456
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia

Re: Mageia 8 & Php - I messed up

Postby doktor5000 » Apr 3rd, '21, 18:24

Well mythweb will probably be deprecated by upstream according to https://github.com/MythTV/mythweb/issue ... -747379877
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16797
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mageia 8 & Php - I messed up

Postby morgano » Apr 4th, '21, 17:27

According to dev list, unofficial PHP7 rpm is being worked on :)
Mandriva since 2006, then Mageia since 2011 at home & work. Thinkpad T43 & T400, Dell M4400, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 812
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: Mageia 8 & Php - I messed up

Postby rtl19 » Apr 9th, '21, 01:59

I intended to throw my steps out there in more detail but life got in the way. YMMV but this is what worked for me.

First, I download the latest stable of php7 from https://www.php.net/downloads.php

Then, I removed all rpm packages that were php8 based. This included things like apache-mod_php. If you have settings in the php.ini, save that file off before you remove all the rpm's for php8.

Then I installed apache-devel package. This is needed in preparation for compiling php7.
Code: Select all
urpmi apache-devel


I then untarred the php7 package I downloaded. This temporary location can be anywhere you want. You can also do this as the non-root user if you want to.
Code: Select all
tar xfz php-7.4.16.tar.gz


Also, don't forget to create the destination directory if you're not going with defaults. For me, I wanted my destination to be /opt/php7
Code: Select all
As root: $ mkdir -m 755 /opt/php7


Now that you have the source code untarred, you'll want to run configure. These are the flags and options I used:
Code: Select all
./configure --prefix /opt/php7 --with-config-file-scan-dir=/etc/php.d --with-curl --enable-exif --enable-ftp --enable-gd --with-gettext --enable-mbstring --with-mysqli --enable-mysqlnd --with-openssl --enable-phpdbg-webhelper --enable-sockets --enable-sysvsem --enable-sysvshm -with-zlib --with-apxs2 --with-mysql-sock  --with-pear


Don't be alarmed if configure errors out with missing packages. Take a look at what package is missing and install them one by one until you get a clean configure run. You'll want to install the '-devel' versions of any packages. For example configure errored out with libxml2 missing:

Code: Select all
$ urpmq --list | grep -i xml2 | grep -i devel
lib64tinyxml2-devel
lib64tinyxml2-devel
lib64xml2-devel
lib64xml2-devel

$ urpmi lib64xml2-devel


Once configure comes back clean. Compile it. For this step you may want to be root so that installation will be smooth.
Code: Select all
make

Once the compile is done, feel free to install it.
Code: Select all
make install


After this I do an extra step of manually putting the libs/libphp7.so in the same directory as the other php7 files. ie:
Code: Select all
cp libs/libphp7.so /opt/php7/lib/php/extensions/libphp7.so


Now that it's all compiled and installed, I still had a few tweaks to ensure apache found it and such. My goal here was to make it as self contained as possible so that if an official Mageia 8 rpm for php7 came around, it would be relatively easy to "dereference" the /opt/php7 I built.

Tweak 1: Make sure there is a /var/lib/php directory and it's writable by apache
Code: Select all
mkdir -m 775 /var/lib/php; chown apache:apache /var/lib/php


Tweak 2: link /opt/php7/php.ini to /etc/php.ini
Code: Select all
cd /opt/php7/lib; ln -s /etc/php.ini .


Tweak 3: link mod_php.so into the apache mod location
Code: Select all
ln -s /opt/php7/lib/php/extensions/libphp7.so /usr/lib64/httpd/modules/mod_php.so


Tweak 4: Add /opt/php7 to /etc/php.ini in key spots. These are from my /etc/php.ini file:
Code: Select all
include_path = ".:/usr/lib64/php/:/usr/share/pear/:/usr/share/php/:/opt/php7:/opt/php7/lib/php:/opt/php7/include/php"
extension_dir = "/usr/lib64/php/extensions:/opt/php7/lib/php/extensions"


Tweak 5: If you have /etc/httpd/conf/modules.d/70_mod_php.conf or anything in your modules config directory that references php, make sure it says php7.
Here's my content of 70_mod_php.conf. The only real change was 'LoadModule php_module' was changed to 'LoadModule php7_module'
Code: Select all
LoadModule php7_module modules/mod_php.so

AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps

DirectoryIndex index.php index.phtml


Tweak 6: Make a slight change to /etc/httpd/conf.d/security.conf if you have it. I changed the line:
Code: Select all
   <IfModule !mod_php.c>
to
   <IfModule !mod_php7.c>



I think that's it. Good luck!
R
rtl19
 
Posts: 10
Joined: Mar 6th, '21, 22:06

Re: [WORKAROUND] Mageia 8 & PHP7

Postby doktor5000 » Apr 9th, '21, 17:04

Thanks for sharing, I've moved this into our tips&tricks section.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16797
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mageia 8 & Php - I messed up

Postby Cled » Apr 22nd, '21, 05:47

Thanks a lot rtl19 for this detailed procedure.

I passed all the first steps, untar php7 in a folder of my "home", then doing successfully in this folder the "configure" step, and the "make" step.

But I get stuck at the "make install" stage, with this message:

Code: Select all
$ make install
Installing PHP SAPI module:       apache2handler
/usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' libphp7.la /usr/lib64/httpd/modules
/usr/lib64/apr-1/build/libtool --mode=install install libphp7.la /usr/lib64/httpd/modules/
libtool: install: install .libs/libphp7.so /usr/lib64/httpd/modules/libphp7.so
libtool: install: install .libs/libphp7.lai /usr/lib64/httpd/modules/libphp7.la
libtool: warning: remember to run 'libtool --finish /home/moi/MPI/PHP-7/php-7.4.16/libs'
chmod 755 /usr/lib64/httpd/modules/libphp7.so
apxs:Error: Activation failed for custom /etc/httpd/conf/httpd.conf file..
apxs:Error: At least one `LoadModule' directive already has to exist..
make: *** [Makefile:156 : install-sapi] Erreur 1


Unfortunately, I can't solve this problem by myself.
Cled
 
Posts: 3
Joined: Apr 22nd, '21, 05:36

Re: [WORKAROUND] Mageia 8 & PHP7

Postby doktor5000 » Apr 22nd, '21, 16:46

And what does your /etc/httpd/conf/httpd.conf currently look like ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16797
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [WORKAROUND] Mageia 8 & PHP7

Postby Cled » Apr 24th, '21, 06:27

Thanks doctor500 for your answer. I was able to solve this first problem, and go through all the following steps, except that... PHP still doesn't work.

1) For the "make install" step, I was missing a line to add in my /etc/httpd/conf/httpd.conf file

Just after the line "Include conf/modules.d/*.conf", I had to add this line:

Code: Select all
LoadModule php7_module modules/mod_php.so

(Solution found here : https://itroger.wordpress.com/2016/10/22/installing-php7-in-mageia-5/
I just added the "7" in "php7_module", as advised by rtl19).

2) Then I followed all the steps indicated by rtl19, including all the tweaks.

3) Unfortunately, PHP still doesn't work:

Code: Select all
# php -v
bash: php : commande introuvable
# php7 -v
bash: php7 : commande introuvable

I redid a "make install" to get the log (I didn't keep the log of the first successful "make install"), and this is what I get:

Code: Select all
# make install
/bin/sh /home/moi/MPI/PHP-7/php-7.4.16/libtool --silent --preserve-dup-deps --mode=install cp ext/opcache/opcache.la /home/moi/MPI/PHP-7/php-7.4.16/modules
Installing PHP SAPI module:       apache2handler
/usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' libphp7.la /usr/lib64/httpd/modules
/usr/lib64/apr-1/build/libtool --mode=install install libphp7.la /usr/lib64/httpd/modules/
libtool: install: install .libs/libphp7.so /usr/lib64/httpd/modules/libphp7.so
libtool: install: install .libs/libphp7.lai /usr/lib64/httpd/modules/libphp7.la
libtool: warning: remember to run 'libtool --finish /home/moi/MPI/PHP-7/php-7.4.16/libs'
chmod 755 /usr/lib64/httpd/modules/libphp7.so
[activating module `php7' in /etc/httpd/conf/httpd.conf]
Installing shared extensions:     /opt/php7/lib/php/extensions/no-debug-non-zts-20190902/
Installing PHP CLI binary:        /opt/php7/bin/
Installing PHP CLI man page:      /opt/php7/php/man/man1/
Installing phpdbg binary:         /opt/php7/bin/
Installing phpdbg man page:       /opt/php7/php/man/man1/
Installing PHP CGI binary:        /opt/php7/bin/
Installing PHP CGI man page:      /opt/php7/php/man/man1/
Installing build environment:     /opt/php7/lib/php/build/
Installing header files:          /opt/php7/include/php/
Installing helper programs:       /opt/php7/bin/
  program: phpize
  program: php-config
Installing man pages:             /opt/php7/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /opt/php7/lib/php/
[PEAR] Archive_Tar    - already installed: 1.4.9
[PEAR] Console_Getopt - already installed: 1.4.3
[PEAR] Structures_Graph- already installed: 1.1.1
[PEAR] XML_Util       - already installed: 1.4.5
[PEAR] PEAR           - already installed: 1.10.12
Warning! a PEAR user config file already exists from a previous PEAR installation at '/root/.pearrc'. You may probably want to remove it.
Wrote PEAR system config file at: /opt/php7/etc/pear.conf
You may want to add: /opt/php7/lib/php to your php.ini include_path
/home/moi/MPI/PHP-7/php-7.4.16/build/shtool install -c ext/phar/phar.phar /opt/php7/bin/phar.phar
ln -s -f phar.phar /opt/php7/bin/phar
Installing PDO headers:           /opt/php7/include/php/ext/pdo/

I'm stuck again. I don't know what's wrong, and I would welcome any help. :?
Cled
 
Posts: 3
Joined: Apr 22nd, '21, 05:36

Re: [WORKAROUND] Mageia 8 & PHP7

Postby doktor5000 » Apr 24th, '21, 18:03

Cled wrote:3) Unfortunately, PHP still doesn't work:

Code: Select all
# php -v
bash: php : commande introuvable
# php7 -v
bash: php7 : commande introuvable


Well, if you want to run it interactively and don't supply the full path, then /opt/php7/bin/ should be added to your PATH - you can add this e.g. in your ~/.bashrc.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16797
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [WORKAROUND] Mageia 8 & PHP7

Postby Cled » Apr 25th, '21, 14:12

Thanks a lot doktor5000.
(This is the first time I need to compile a program directly. :lol: )

Now PHP-7 is working, and Apache (httpd) too, after restarting it.

But not the site I have to work on, unfortunately. The purpose of this whole operation is to be able to continue my work (front-end, not back-end in PHP that I don't master) on this site: I load it locally on " http://127.0.0.1/ ".
On Mageia 7 (with PHP 7), it worked perfectly. But on Mageia 8, even after uninstalling PHP-8 and installing PHP-7 as seen above, I get this error message when I load my site in the browser (http://127.0.0.1/my-website/public/):

Code: Select all
could not find driver
Fatal error: Uncaught Error: Call to a member function setAttribute() on null in /var/www/html/my-website/public/index.php:43 Stack trace: #0 /var/www/html/my-website/vendor/pimple/pimple/src/Pimple/Container.php(118): {closure}() #1 /var/www/html/my-website/public/controllers/PageController.php(6): Pimple\Container->offsetGet() #2 /var/www/html/my-website/public/index.php(107): require_once('/var/www/html/m...') #3 {main} thrown in /var/www/html/my-website/public/index.php on line 43

Since the site works fine under Mageia 7, is there anything I should have added, or done differently, in the PHP-7 installation under Mageia 8?
Cled
 
Posts: 3
Joined: Apr 22nd, '21, 05:36

Re: [WORKAROUND] Mageia 8 & PHP7

Postby filip » Apr 25th, '21, 19:13

Are you sure that Apache runs php7?

In php 8 error handling is different and more strict.
filip
 
Posts: 456
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia

Re: Mageia 8 & Php - I messed up

Postby filip » Apr 25th, '21, 19:25

filip wrote:@rtl19
Yeah. RPI are really nice. I'll try to create some docs for install and use.

Finally something. ;)
filip
 
Posts: 456
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia

Re: [WORKAROUND] Mageia 8 & PHP7

Postby artee » Jul 19th, '21, 20:36

Okay, I hope some of you are still following this topic, even though I'm late to the party...


Background:
I finally got round to upgrading my server to Mageia 8.
I totally forgot about updating nextcloud (ages ago self installed owncloud) to the latest version, so it was at v19...

Hence I found this thread, for help with Mageia 8 and PHP 7.

I followed the instructions to the letter, but had to get back to the configure step to include zip capabilities (adding --with-zip to the configure command).

I then tried to run the nextcloud upgrade command as apache:
Code: Select all
cd /var/www/html/nextcloud
php updater/updater.phar



Which got me to this point:

Code: Select all
extcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 20.0.10.

Update to Nextcloud 20.0.11 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-20.0.11.zip                                                                                   
Open changelog ↗

Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done

Start update? [y/N] y

Info: Gracefully stopping the updater via Ctrl-C is not possible - PCNTL extension is not loaded.

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[ ] Extracting ...PHP Fatal error:  Uncaught Error: Class 'ZipArchive' not found


Well, there it crapped out the first time on the grounds that it didn't have zip capabilities. After configuring and compiling again (and deleting the .step file that the nextcloud upgrader made, which disables rerunning the same command again), I got to this point:

Code: Select all
-sh-5.1$ php updater/updater.phar
Nextcloud Updater - version: v20.0.0beta4-11-g68fa0d4

Current version is 20.0.10.

Update to Nextcloud 20.0.11 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-20.0.11.zip                                                                                   
Open changelog ↗

Steps that will be executed:
[ ] Check for expected files
[ ] Check for write permissions
[ ] Create backup
[ ] Downloading
[ ] Verify integrity
[ ] Extracting
[ ] Enable maintenance mode
[ ] Replace entry points
[ ] Delete old files
[ ] Move new files in place
[ ] Done

Start update? [y/N] y

Info: Gracefully stopping the updater via Ctrl-C is not possible - PCNTL extension is not loaded.

[✔] Check for expected files
[✔] Check for write permissions
[✔] Create backup
[✔] Downloading
[✔] Verify integrity
[✔] Extracting
[✔] Enable maintenance mode
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Update of code successful.

Should the "occ upgrade" command be executed? [Y/n] y
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: could not find driver in /var/www/html/nextcloud/lib/private/DB/Connection.php:72
Stack trace:
#0 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1449): OC\DB\Connection->connect()
#1 /var/www/html/....


I realise I miss a simple step somewhere, that enables the DB connecting driver, or makes it known to php...
I've searched all over the place (gosh the internet got full of noise, all this was 1000x easier to debug 15 years ago), did the php db connection test (which fails) here:
https://help.nextcloud.com/t/error-500- ... er/99856/2
and I get the same message that is mentioned there:
“Connection failed: could not find driver”

I feel I'm so close and yet so far - any help? Hints? Stuff I can try? Search terms that may help?
Thanks in advance!!
artee
 
Posts: 35
Joined: Jun 15th, '13, 14:00

Re: [WORKAROUND] Mageia 8 & PHP7

Postby artee » Jul 22nd, '21, 17:59

Okay, I managed to fix things. It was quite a journey, finding out things that I had no knowledge of before, and no real interest of learning to be honest...

On the driver thingy, I needed the additional option --with-pdo-mysql for the configure command:
Code: Select all
./configure --prefix /opt/php7 --with-config-file-scan-dir=/etc/php.d --with-curl --enable-exif --enable-ftp --enable-gd --with-gettext --enable-mbstring --with-mysqli --enable-mysqlnd --with-openssl --enable-phpdbg-webhelper --enable-sockets --enable-sysvsem --enable-sysvshm -with-zlib --with-apxs2 --with-mysql-sock  --with-pear --with-zip --with-pdo-mysql


That allowed me to get through on the Nextcloud upgrade command (as user apache, in the Nextcloud folder):
Code: Select all
./occ upgrade


I got to version 20.0.11., then did the command again to update to Nextcloud 21.0.3, but halfway through it failed at
Code: Select all
Should the "occ upgrade" command be executed? [Y/n]
An unhandled exception has been thrown:
OC\HintException: [0]: Memcache \OC\Memcache\Redis not available for distributed cache (Is the matching PHP module installed and enabled?)

Keep maintenance mode active? [y/N] y
Maintenance mode kept active


To get around this, I edited the file nextcloud/config/config.php to (temporarily) not use Redis, I just took out the couple of related lines. (Made a copy, made the modifications and at the installation of php8 undid it, to be exact.)

Then I finally got this:
Code: Select all
Update successful
Maintenance mode is kept active
Resetting log level

Yay!

I then undid all modifications, and used urpmi to install php8 once again, plus all other packages that were deinstalled when I deinstalled it.

I finally did, as root:
Code: Select all
systemctl restart httpd.service

and as apache:
Code: Select all
./occ maintenance:mode --off


And then the web access worked again.
Hurray, drinks all around!
:D


Some things I found out that I didn't want to know:
If you install a VirtualBox guest (Mageia 7 -- my alternative option to use that with php7 to fix my Nextcloud) on a regular Plasma desktop (with a monitor, not headless or in a vnc session) that you connect with through krfb, and you have a keyboard with deadkeys, you get only weird deadkeys. Greek, non-latin, all kinds.
Worst: at some point various kde text boxes were showing the right letters, but! in Konsole I still only got all characters as if atl-gr was held down continuously.
Also, VirtualBox is a bit of a security risk, because if I run it as a user, then inside NFS-share the host exports, I can then do "su - <username>" and access/edit files as any user (that has a matching uid/gid on the guest as on the exported system - easy to fabricate), if the export is with no_root_squash even as root. That last thing is to be avoided anyway, and the rest is valid for any machine on your network. Yes, I don't use kerberos...
artee
 
Posts: 35
Joined: Jun 15th, '13, 14:00

Re: [WORKAROUND] Mageia 8 & PHP7

Postby flink » Aug 5th, '21, 09:04

Does anyone have a solution for an easy way to just install a PHP7-RPM under Mageia8?
flink
 
Posts: 98
Joined: Mar 3rd, '12, 19:23


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest