Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-03-29 11:28:24

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

[SOLVED] Installing database gives error

Screenshot

PHP 8.2
Textpattern 4.8.8

What’s wrong?

[Edit]
PHP mysqli extension wasn’t running … :o

Last edited by RedFox (2023-03-29 11:43:36)

Offline

#2 2023-03-29 12:56:22

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: [SOLVED] Installing database gives error

We have issue 1309 which covers this partially, but that’s aimed at existing installations and a preflight check for an intended version upgrade. It makes sense to me to have some automated checking in the installer that the required components are available, and a report on the optional components (I know of some other PHP apps that check during install), rather than just for existing installations.

Offline

#3 2023-03-29 17:30:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: [SOLVED] Installing database gives error

Y’know, we should probably revisit that issue and just blitz it, adding any checks in core. We do rudimentary checks (e.g. is PHP version high enough) but beyond that, nothing much.

Since we list the system requirements and direct people there prior to upgrades, it would make sense to at least list what the server environment has available so admins can check diagnostics to see what’s supported and cross ref it with the published list.

I think checking compatibility of extensions for incoming version upgrades is probably a step too far, logic wise. I.e. if you want to install 4.9.0, it somehow lists incompatible issues near the “upgrade available” message. That would be hard to pull off. But a manual cross check with what’s there vs what we publish as required would make sense.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2023-03-31 10:56:10

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: [SOLVED] Installing database gives error

Bloke wrote #335201:

Since we list the system requirements and direct people there prior to upgrades, it would make sense to at least list what the server environment has available so admins can check diagnostics to see what’s supported and cross ref it with the published list.

I remember Magento had a preflight .php checker that we could perhaps crib, let me see if I can find it…

Edit: voila–

<?php

extension_check(array(
	'curl',
	'dom', 
	'gd', 
	'hash',
	'iconv',
	'mcrypt',
	'pcre', 
	'pdo', 
	'pdo_mysql', 
	'simplexml'
));

function extension_check($extensions) {
	$fail = '';
	$pass = '';

	if(version_compare(phpversion(), '5.2.0', '<')) {
		$fail .= '<li>You need<strong> PHP 5.2.0</strong> (or greater)</li>';
	}
	else {
		$pass .='<li>You have<strong> PHP 5.2.0</strong> (or greater)</li>';
	}

	if(!ini_get('safe_mode')) {
		$pass .='<li>Safe Mode is <strong>off</strong></li>';
		preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);

		if ($version) {
			if(version_compare($version[0], '4.1.20', '<')) {
				$fail .= '<li>You need<strong> MySQL 4.1.20</strong> (or greater)</li>';
			}
			else {
				$pass .='<li>You have<strong> MySQL 4.1.20</strong> (or greater)</li>';
			}
		} else {
			$pass .='<li>You probably have<strong> MySQL 4.1.20</strong> (or greater)</li>';
		}
	}
	else { $fail .= '<li>Safe Mode is <strong>on</strong></li>';  }

	foreach($extensions as $extension) {
		if(!extension_loaded($extension)) {
			$fail .= '<li> You are missing the <strong>'.$extension.'</strong> extension</li>';
		}
		else{	$pass .= '<li>You have the <strong>'.$extension.'</strong> extension</li>';
		}
	}

	if($fail) {
		echo '<p><strong>Your server does not meet the following requirements in order to install Magento.</strong>';
		echo '<br>The following requirements failed, please contact your hosting provider in order to receive assistance with meeting the system requirements for Magento:';
		echo '<ul>'.$fail.'</ul></p>';
		echo 'The following requirements were successfully met:';
		echo '<ul>'.$pass.'</ul>';
	} else {
		echo '<p><strong>Congratulations!</strong> Your server meets the requirements for Magento.</p>';
		echo '<ul>'.$pass.'</ul>';

	}
}

Last edited by gaekwad (2023-03-31 11:01:18)

Offline

#5 2023-03-31 11:20:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: [SOLVED] Installing database gives error

Lovely, thank you. I’ll, uhhh, pay homage to that in our pre-flight check.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2023-03-31 11:37:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: [SOLVED] Installing database gives error

Interestingly, we already list all loaded extensions in diagnostics, it’s just that (for whatever reason) it was never displayed. I’ve enabled that first, then I’ll look at comparing that to the list of required extensions and pull those out separately to highlight them.

Last edited by Bloke (2023-03-31 11:41:05)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2023-03-31 11:59:11

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: [SOLVED] Installing database gives error

Bloke wrote #335218:

I’ll, uhhh, pay homage to that in our pre-flight check.

It’s Magento v1 era stuff, it sort of worked…but caveat emptor and don’t shoot the messenger!

Offline

#8 2023-03-31 15:46:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: [SOLVED] Installing database gives error


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#9 2023-03-31 20:22:56

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: [SOLVED] Installing database gives error

Bloke wrote #335225:

Owzat?

Nice, much handier than before. It just lacks ‘event trigger’ and ‘export’ functionality to replace the plugin composer.

Offline

#10 2023-04-01 09:39:37

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: [SOLVED] Installing database gives error

RedFox wrote #335188:

PHP 8.2
Textpattern 4.8.8

What’s wrong?

They are not officially fully compatible. A future version of Textpattern will be compatible with PHP 8.2, see #1802 for more info.

Offline

Board footer

Powered by FluxBB