Jump to content

Archived

This topic is now archived and is closed to further replies.

kris49

mysql The MySQL extension is required

Recommended Posts

Bonjour

 

je m'appel KRIS , j'installe un nouveau site de E-commerce pour mon Club AUTO mais cela ne fonctionne pas .

 

 

Voici le message d'erreur 

 

New Installation

mysql

The MySQL extension is required but is not installed. Please enable it to continue installation.

Please correct the above errors and retry the installation procedure with the changes in place.

Changing webserver configuration parameters may require the webserver service to be restarted before the changes take affect.

Server Capabilities

PHP Version

7.0.0

 

 

PHP Settings

register_globals

Off

 

magic_quotes

Off

 

file_uploads

On

 

session.auto_start

Off

 

session.use_trans_sid

Off

 

 

Required PHP Extensions

MySQL

 

 

Recommended PHP Extensions

GD

 

cURL

 

OpenSSL

 

 

 

Merci pour votre aide 

Share this post


Link to post
Share on other sites

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

What version of osCommerce are you trying to install? Old versions used only the MySQL extension, which I'm not sure is still offered with PHP 7. Newer versions use the MySQLi extension, which should be built into your PHP. If you run the following one-line script:

<?php phpinfo(); ?>

does it tell you that either MySQL or MySQLi (or both) are installed? If not, you need to talk to your host -- one or the other (preferably MySQLi) should be installed on any PHP for a web server.

 

As @@Gergely mentioned, there was a known problem in osC with it not recognizing a MySQL installation. I think it's fixed in osC 2.3.4BS (not the 2.3.4 version). If you're starting a new shop, you should really be using 2.3.4BS, as it's mobile-friendly and much more up to date.

Share this post


Link to post
Share on other sites

merci pour vos reponses .

 

Je vous explique , je ne suis pas un champion en informatique. et j'instal une boutique sur mon mac pour la premiere fois .

 

le message d'erreur qui apparait correspond a la réponse de  Gergely mais je ne comprend pas ce que je doit faire avec les ligne de code .

Share this post


Link to post
Share on other sites

I install a shop on my mac for the first time.

 

I hope you're running this on a PC or Mac only to play with it and try it out! Real stores accessible by the public should always be installed on commercial servers whose staff understand all security issues. If you try running a public-facing website on your own computer, especially a store selling real merchandise for real money, the hackers will eat you alive.

 

If this is a MAMPP installation, it ought to include at least the MySQL PHP extension (or better, MySQLi). If you had to do any configuring on your setup, perhaps you missed that extension. Put the phpinfo line I gave you in its own file and run it on your server. It should tell you that MySQL, MySQLi, or both are installed. If it doesn't, you did something wrong installing it. If you confirm that MySQL or MySQLi is installed and available in PHP, then there might be some issue in osCommerce. Exactly what version of osC are you trying to set up? If this is a brand new store, you should definitely go with osC 2.3.4BS and not the old 2.3.4.

 

There may be a few further issues if your server is PHP 7. You may end up rolling back to PHP 5.6, which osC 2.3.4BS is known to work well with. If you want to stay at PHP 7, there may be some minor fixes you have to make to the osC code (class constructor names, for instance).

Share this post


Link to post
Share on other sites

/install/templates/pages/index.php

 

Find:

 

    if (!extension_loaded('mysql')) {
      $warning_array['mysql'] = 'The MySQL extension is required but is not installed. Please enable it to continue installation.';
    }

 

Change to:

 

 

    $db = 0;
    if (extension_loaded('mysql')) $db++;
    if (extension_loaded('mysqli')) $db++;
    if ($db == 0) {
      $warning_array['mysql'] = 'The MySQL(i) extension is required but is not installed. Please enable it to continue installation.';
    }

 

 

Please test this and confirm if working.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

/install/templates/pages/index.php

 

Find:

    if (!extension_loaded('mysql')) {
      $warning_array['mysql'] = 'The MySQL extension is required but is not installed. Please enable it to continue installation.';
    }

Change to:

    $db = 0;
    if (extension_loaded('mysql')) $db++;
    if (extension_loaded('mysqli')) $db++;
    if ($db == 0) {
      $warning_array['mysql'] = 'The MySQL(i) extension is required but is not installed. Please enable it to continue installation.';
    }

Please test this and confirm if working.

 

 

Hi Burt
 
The latest version of xampp includes PHP 7.0.4 and this causes a problem with the oscommerce install.
 
Your code fixes the install issue however there are then numerous
 
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP
 
errors. 
 
Regards
 
Ken

Share this post


Link to post
Share on other sites

@@Ken44 https://github.com/gburton/Responsive-osCommerce/issues/288
 

Not aimed at anyone in particular:
I need the help of every user of the Responsive version, be that in terms of code, or by allowing code-time to be created (how to do that is easy, ask).  It's got to the point where there are enough shopowners (more than 300) using this version to each help out as best they can.  If each gave a little time/effort/cash, this Community Edition could be completed more quickly and more accurately.


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

A cleaner update to/install/templates/pages/index.php:

 

Find:

 

    if (!extension_loaded('mysql')) {
      $warning_array['mysql'] = 'The MySQL extension is required but is not installed. Please enable it to continue installation.';
    }
 

Change to:

 

    if (!extension_loaded('mysql') &&
        !extension_loaded('mysqli')) {
      $warning_array['mysql'] = 'The MySQL[i] extension is required but is not installed. Please enable it to continue installation.';
    }
 

The latest version of xampp includes PHP 7.0.4 and this causes a problem with the oscommerce install.

 

Your code fixes the install issue however there are then numerous

 

 

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

 

As I said...

There may be a few further issues if your server is PHP 7. You may end up rolling back to PHP 5.6, which osC 2.3.4BS is known to work well with. If you want to stay at PHP 7, there may be some minor fixes you have to make to the osC code (class constructor names, for instance).

A starting place on discussions about this:

http://forums.oscommerce.com/topic/408220-php-7/?hl=%2Bclass+%2Bconstructor#entry1739026

Share this post


Link to post
Share on other sites

@@MrPhil what if mysql is not loaded and mysqli is loaded...or vice versa.

 

 

if (!extension_loaded('mysql') && !extension_loaded('mysqli')) {

Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
Share on other sites

If either is loaded, the message will not be given. Both tests have to be false (not loaded) and the ! reverses them, and the && makes so both have to be true (after the !) to trigger the error. If one is loaded, the test is true, !test is false, and the && fails.

 

 

!test1 && !test2

is equivalent to

 

!(test1 || test2)

 

Besides, if mysql is loaded, the first !test will fail, and it won't spend the time testing if mysqli is loaded (moot point).

Share this post


Link to post
Share on other sites

osCommerce Online Merchant v2.3.4!

PHP Version 7.0.0

MAC osx el captain 10.11.3

 

sur le fichier    /Applications/MAMP/htdocs/install/templates/pages.php

 

j'ai changé à la ligne 146  147 et 148 

 

 
  if (!extension_loaded('mysql')) {
    $warning_array['mysql'] = 'The MySQL extension is required but is not installed. Please enable it to continue installation.';
  }
 
 
 
par  
 
 
if  (! extension_loaded ( 'mysql' ) &&
! ​​extension_loaded ( 'mysqli' )) {
      warning_array $ [ 'mysql' ] = 'MySQL extension de est nécessaire , mais n'est pas installé. S'il vous plaît lui permettre de poursuivre l' installation. ;
    }
 
 
cela n'a pas fonctionné , jai toujours le message 
 
 

New Installation

mysql

The MySQL extension is required but is not installed. Please enable it to continue installation.

Please correct the above errors and retry the installation procedure with the changes in place.

Changing webserver configuration parameters may require the webserver service to be restarted before the changes take affect.

 

Retry

Share this post


Link to post
Share on other sites

What do you see in phpMyadmin? What is your oscommerce database name?


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

You changed your error message to "MySQL extension de est nécessaire , mais n'est pas installé. S'il vous plaît lui permettre de poursuivre l' installation.", but are still getting the message displayed "The MySQL extension is required but is not installed. Please enable it to continue installation."? It sounds like you did not successfully upload the change to your server.

Share this post


Link to post
Share on other sites

×