Joomla 1.5 on PHP7 = JError Unable to load Database Driver

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
GTAlex
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Mar 03, 2017 9:05 am

Joomla 1.5 on PHP7 = JError Unable to load Database Driver

Post by GTAlex » Fri Mar 03, 2017 9:08 am

Joomla 1.5 on PHP7

dbtype = "mysqli"
"JError Unable to load Database Driver"

try dbtype = "mysqli"
again
"JError Unable to load Database Driver"


help!

mbabker
Joomla! Hero
Joomla! Hero
Posts: 2176
Joined: Sun Feb 28, 2010 8:26 pm

Re: Joomla 1.5 on PHP7 = JError Unable to load Database Driver

Post by mbabker » Fri Mar 03, 2017 1:29 pm

1.5 is not compatible with PHP 7. The last version it was actually compatible with without PHP warnings is PHP 5.3; it will run OK on 5.4 (and supposedly 5.5, I'm not sure on 5.6) but you will need to turn off error reporting because the platform will emit a lot of strict standards warnings due to its PHP 4 compatibility. You will need to downgrade PHP.
So long and thanks for all the fish.

Manually updating Joomla? See https://gist.github.com/mbabker/d7bfb4e ... 3607f89281

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 26762
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: Joomla 1.5 on PHP7 = JError Unable to load Database Driver

Post by imanickam » Fri Mar 03, 2017 1:43 pm

I doubt whether Joomla! 1.5 will run on PHP 7. As you would notice from the document https://docs.joomla.org/Joomla_1.5_won' ... on_PHP_5.4 Joomla! 1.5 will not even work on PHP 5.4.

Be known that Joomla! 1.5 is no longer supported. The last version of Joomla! 1.5 is 1.5.26. In addition, there are two security hot fixed after v1.5.26.


Note:
As Joomla! 1.5 is no longer supported, you must plan to upgrade your site to Joomla! 3.6.5 (which is the latest version at present). Do the upgrade/migration in a test environment before attempting to upgrade the production live site.
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Global Moderators Team | Translations Coordination Team | Tamil (தமிழ்) Translation Team

Eegan - Support the poor and underprivileged

ocelot_pl
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jul 02, 2018 11:15 am

Re: Joomla 1.5 on PHP7 = JError Unable to load Database Driver

Post by ocelot_pl » Mon Jul 02, 2018 11:37 am

I know that Joomla 1.5 is not supported on PHP 7, but easier for me was to adopt it to PHP 7.1 than convert the whole site. ;)

You need to do a few small modifications:

1) Type in config files 'mysqli' instead of 'mysql'
configuration.php
libraries/joomla/config.php - update here fields with database settings: connection, username, password, etc

2) Modify the file includes\framework.php

Code: Select all

@set_magic_quotes_runtime( 0 );
change to

Code: Select all

if(version_compare(PHP_VERSION, '5.3.0', '<')) 
{
  @set_magic_quotes_runtime( 0 ); 
}
or if you are not going to come back to the previous version of PHP, you can comment the line, or delete it

Code: Select all

//@set_magic_quotes_runtime( 0 );
Find all other instances of this function in .php files and do the same.
In my project I had to do the same in the following files:

Code: Select all

administrator/includes/framework.php 
includes/framework.php 
plugins/editors/xstandard/attachmentlibrary.php
plugins/editors/xstandard/directory.php 
plugins/editors/xstandard/imagelibrary.php
...
3) Modify the function in the file
libraries/joomla/registry/registry.php

Code: Select all

	/**
	 * Get a registry value
	 *
	 * @access	public
	 * @param	string	$regpath	Registry path (e.g. joomla.content.showauthor)
	 * @param	mixed	$default	Optional default value
	 * @return	mixed	Value of entry or null
	 * @since	1.5
	 */
	function getValue($regpath, $default=null)
	{
		// Initialise variables.
		$result = $default;

		if (!strpos($regpath, '.'))
		{
			return (isset($this->data->$regpath) && $this->data->$regpath !== null && $this->data->$regpath !== '') ? $this->data->$regpath : $default;
		}
		// Explode the registry path into an array
		$nodes = explode('.', $regpath);

		// Get the namespace
		//$namespace = array_shift($nodes);
		$count = count($nodes);
		if ($count < 2) {
			$namespace = $this->_defaultNameSpace;
			$nodes[1]  = $nodes[0];
		} else {
			$namespace = $nodes[0];
		}

		// Initialize the current node to be the registry root.
		//$node = $this->data;
		$node = $this->_registry[$namespace]['data'];

		$found = false;
		$skip_first = true;

		// Traverse the registry to find the correct node for the result.
		foreach ($nodes as $n)
		{

			if(!$skip_first)
			{
				if (isset($node->$n))
				{
					$node = $node->$n;
					$found = true;
				}
				else
				{
					$found = false;
					break;
				}
			}

			$skip_first = false;
		}
		if ($found && $node !== null && $node !== '')
		{
			$result = $node;
		}

		return $result;
	}
4) Modify the function in the file
administrator/components/com_joomlastats/count.classes.php

Code: Select all

			if( ereg( '([a-zA-Z])', $xt ) ) {
replace with:

Code: Select all

			if( preg_match( '([a-zA-Z])', $xt ) ) {
5) To reduce the number of warnings in the error_log file you can add the following line at the beginning of the index.php file:

Code: Select all

error_reporting(E_ALL ^ (E_NOTICE | E_WARNING | E_DEPRECATED));
After this changes, I ran my Joomla 1.5 website on PHP 7.1 successfully.

Let the force be with you.
;)


Post Reply

Return to “Administration 1.5”