OpenCart: Fatal Error: Class 'Mysqli' Line 7 - php

I have problem for installation OpenCart in cPanel with Softacolous, when I'm finished for install and during open the site I have message:
Fatal error: Class 'mysqli' not found in /home/radiance/public_html/shoukhin/system/library/db/mysqli.php on line 7
==Info:==
OpenCart:
Version: 2.0.3.1, 1.5.6.4
Release Date: 29-05-2015
Anything more to solve or get ans? Anyone there to solve it?

Please install mysqli into your centos server .
To install mysqli using EachApache:
Login to WHM as 'root' user.
Either search for "EasyApache" or go to Software > EasyApache
Scroll down and select a build option (Previously Saved Config)
Click Start "Start customizing based on profile"
Select the version of Apache and click "Next Step".
Select the version of PHP and click "Next Step".
Choose additional options within the "Short Options List"
Select "Exhaustive Options List" and look for "MySQL Improved extension"
Click "Save and Build"

I recently faced the same issue, that Class mysqli not found. And found out that this particular issue is not related to OpenCart. It is related to the PHP version that your OpenCart is using and the PHP version that your server is supporting.
So make sure sure PHP version mentioned during configuration is matched with PHP version that your server is running.
In my case my server was running PHP 7.4 and OpenCart was configured for PHP 7.3. So the problem was solved by changing my server's PHP version to 7.3.
And lived Happily forever after....

In cPanel, just goto your php version, make sure you are on 7.3 and enable nd_mysqli. That fixed it for me.

Related

OJS Error in search page, after upgrading to OJS version from version 3.3.0.13 to version 3.3.0.14

After upgrading OJS version from 3.3.0.13 to 3.3.0.14 I start having problems in search page.
The advanced search parameters not showing, and I get the following error in PHP:
PHP Fatal error: Uncaught Error: Class 'IntlDateFormatter' not found in
….\lib\pkp\lib\vendor\php81_bc\strftime\src\php-8.1-strftime.php:60\nStack
I try to clean cache, but the problem maintains.
The problem was because I dot not have the php extension php_intl setting in my system.
The solution was adding the “extension=php_intl.dll” line in my php.ini configuration file.

Wordpress Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /wp-includes/wp-db.php:1570

I am in big trouble. I installed a nulled version of woocommerce cart based shipping plugin and i found it not relevant according to my requiremnet and deleted that plugin from plugins area. After deleting that plugin my site went down. Its continuously showing me Fatal error:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/dev/public_html/new/wp-includes/wp-db.php:1570
Stack trace:
#0 /home/dev/public_html/new/wp-includes/wp-db.php(658): wpdb->db_connect()
#1 /home/dev/public_html/new/wp-includes/load.php(404): wpdb->__construct('dev_test', 'password', 'dev_test_ne...', 'localhost')
#2 /home/dev/public_html/new/wp-settings.php(107): require_wp_db()
#3 /home/dev/public_html/new/wp-config.php(82): require_once('/home/dev/p...')
#4 /home/dev/public_html/new/wp-load.php(37): require_once('/home/dev/p...')
#5 /home/dev/public_html/new/wp-blog-header.php(13): require_once('/home/dev/p...')
#6 /home/dev/public_html/new/index.php(17): require('/home/dev/p...')
#7 {main} thrown in /home/dev/public_html/new/wp-includes/wp-db.php on line 1570
I tried replacing all core files excluding wp-config.php and wp-content folder. Still I am getting the same error.
Also, i tried renameing plugins folder but the error is there.
Can you guys suggest me how i can get my site back.
I encountered this problem upgrading from PHP 5 to PHP 7 (on Windows). The problem was mysqli PHP extension was not enabled. If mysqli is not available Wordpress 5+ detects this and will instead attempt to connect to the database with deprecated mysql_connect() calls. This leads to a very misleading error message about mysql_connect() function not being available (since we don't want this function).
In php.ini make sure extension_dir is set (use full directory name) and mysqli extension is enabled
extension_dir = "C:\php-7.3.10\ext"
...
extension=mysqli
To double check what extensions are active you can run the following code
<pre>
<?php print_r(get_loaded_extensions()); ?>
</pre>
Possible error sources:
Since PHP 7, mysql_* functions have been removed, see PHP's official overview of the MySQL drivers.
You use PHP 5.x and have not enabled the mysql extension, but mysqli and/or pdo_mysql instead.
You can set
define('WP_USE_EXT_MYSQL', true);
in your wp-config.php file to make WordPress use the mysqli extension.
It happens for me when I switch from 5.6 php to 7.0.
Just enable "mysqli" in your select php version if you use cPanel.
Just registered to give a big thank you for the solution of enabling mysqli. I have been struggling to get WordPress running on a Synology for the past 3.5 hours and this finally fixed my dreaded "The site is experiencing technical difficulties."
For any other Synology users ending up in this topic after trying to find a solution, to fix this on Synology, you need to...
Go to Web Station
Select PHP Settings
Double-click the PHP profile you are using (or click once and choose [Edit])
Select General Settings and scroll to the extensions list
Find mysqli and enable by placing a checkmark
Push the [OK] button (no restart required)
Please check your wp-config.php file for the following line:
define('WP_USE_EXT_MYSQL', true);
If you find it, delete the line. Your problem should be fixed.
If not, you can tick nd_mysqli extension in the PHP 7 configuration, and disable the mysqli extension on Cpanel -> Select PHP version.
Source:
https://wordpress.org/support/topic/database-cache-causing-503-errors-when-upgrading-to-php-7/
Hope this helps. :)
The error seems be simple, mysql_* functions are not enabled.
Check with phpinfo() if these functions are truly disabled, and if yes, enable it.
If no, there are some problems in the code that you are using, but if you have replaced all files as you write, is most probably the first option.
Just had a similar problem with a cpanel multiphp instance. Tried just about everything but while cpanel/whm was saying all was fine, the site would crash when 7.x was activated.
In the end, it was the .htaccess file. We renamed and let Cpanel regenerate and all is good.
Hope this helps someone out there as it took some time to resolve here.
i had same kind of issue for my web hosting client at magicworkshost , i have updated php version from 5.6 to 7.3 and issue resolved successfully.
Thanks
sudo apt-get install php7.4-mysql
sudo service apache2 restart

How do I enable mbstring on our PHP 5.4.33 Apache Server?

I recently moved to an unmanaged VPS and added a Joomla component to a client website and received the following error when attempting to use a specific part of the component.
Fatal error: Call to undefined function mb_strtolower() in /home/oursite/public_html/components/com_rsfiles/helpers/files.php on line 135
I'm sure if this was on a shared machine the error would not have been thrown because they would have configured the server to accept it. But that is not my case. I have to configure it to work.
The original error lead me to identify if mbstring was enabled on our server and it was not.
So I wondered how I could enable it. Googled it! found it may be a derivative of the php.ini file so I tried to enable it using this php.ini definition. zend.multibyte = 1. After adding the line I restarted the Apache web server but the php info page still showed it disabled. :-(
After making the above modification I received a different error when attemoting to access the same page throwing the original error. This is the new error:
Fatal error: Could not convert the script from the detected encoding "UTF-8" to a compatible encoding in /home/psgadmincore/public_html/libraries/legacy/controller/legacy.php on line 609
There are 8 other mbstring items in the php.ini file but they are all commented out.
;mbstring.language = Japanese
;mbstring.internal_encoding = EUC-JP
;mbstring.http_input = auto
;mbstring.http.output = SJIS
;mbstring.encoding_translation = On
;mbstring.detect_order = auto
;mbstring.substitute_character = none
;mbstring.func_overload = 0
I un-commented all of these thinking they had to be enabled also, but the "Could not convert the script" error is returned.
Can someone please direct me to a procedure that outlines the steps necessary to include the "Multibyte String library"?
CENTOS 6.7 x86_64 virtuozzo w/Cpanel - php 5.4.33
These sites have not help me:
http://php.net/manual/en/ref.mbstring.php
http://php.net/manual/en/ini.core.php#ini.zend.multibyte
Thank you
After #ceejayoz response I though I would upgrade the php build to 5.6. I used EasyApache in the WHM to carry out the process below. During the upgrade I was able to select mbstring module in the Exhaustive Options List.
Log in to WHM as the 'root' user. In the Find box type easy. Click
EasyApache (Apache Update). Leave default, and then click the gear
icon (Customize Profile).
Leave default, and then click Next Step.
Click Exhaustive Options List. (this is where I selected the
mbstring module)
Click the name of the Apache or PHP module, and then click Save and build.

WHM Pdo extension installation from php config

Can anyone help me on how to install the pdo mysql extension from whm. i rebuilt the server and installed it from apache update but it doesn't work. i get the below error.
Fatal error: Class 'PDO' not found in /home/mercygirlsschool/public_html/eduportal/schooloffice/MySqlExcelBuilder.class.php on line 40
Apache uses the system PHP, which you will find here:
/usr/bin/php
/usr/local/bin/php
/usr/local/apache/modules/libphp5.so
To enable PDO in the system PHP:
Login to WHM
Click Apache Update
Click Start Customizing Based on Profile
Select an Apache version
Click Next Step
Select PHP 5
Click Next Step
Select a version of PHP 5
Click Next Step
Click Exhaustive Options List button
Scroll down to the check box labeled PDO
Click Save and Build
Src: http://forums.cpanel.net/f5/enable-pdo-78853.html
+1 to above answer and you can follow as well if wanted to install from Putty...
Enabling PDO in the system using Putty:
Login to Server
Run command as /scripts/easyapache
Select an Apache version
Click Next Step
Select a version of PHP 5
Click Next Step
Click Exhaustive Options List button
Scroll down to the check box labeled PDO
Click Save and Build

"The specified procedure could not be found" IIS 6.0 and PHP5

I am trying to make PHP5 work over IIS 6.0 on Windows server 2003 and i am following this steps:
http://www.iisadmin.co.uk/?p=4
The thing is, there's no file named "php5isapi.dll" inside the php folder, so I am using php5isapi.dll instead. Is it correct? Or should I try to download the php5isapi.dll from somewhere.
Well, then, I keep following the steps and when I try to execute my php file, I get this message:
The specified procedure could not be found.
What am I doing wrong?
Thanks.
UPDATE
I downloaded php5isapi.dll and tried to make it work with it but i am getting this error:
The specified module could not be found.
Also, after any change, i restart the Default Web Site clicking on stop and play.
UPDATE 2
Now, after rebooting, when trying to access the PHP file, the browser shows a 500 error:
The page cannot be displayed
I noticed that "php5isapi.ll" is no longer available for the last versions of PHP as pointed in here:
Why is php5isapi.dll missing after installing PHP for Windows?
Therefor, what i did was following this tutorial in order to do it with FastCGI
http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis-60
I found it on this comment:
Why is php5isapi.dll missing after installing PHP for Windows?
After restarting the server, it finally worked.

Categories