Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Which PHP Extensions should you have enabled?
Author « Topic »  

ITZAP
Ecommerce Template Guru

Australia
1016 Posts

Posted - 03/21/2022 :  20:31:44  
When switching between PHP Versions in cPanel, I made the mistake of presuming the default set of PHP Extensions enabled would be adequate to run Ecommerce Templates.

Wrong

PHP v8.0 Default Extensions.
ECT Website: Unable to handle this request. HTTP ERROR 500.


PHP v8.0 Modified Extensions, Enabled:
- imagick
- memcached
- nd_mysqli
- nd_pdo_mysqli
- opcache
- zip
ECT Website: Loads and runs fine.


PHP v8.1 Default Extensions.
ECT Website: Loads and runs fine.


However, are there other extensions there that should be enabled (or disabled) to make an Ecommerce Templates website run more efficiently
All advice appreciated.

Gary

Edited by - ITZAP on 03/22/2022 18:11:43

1818charlie
ECT Moderator

United Kingdom
1192 Posts

Posted - 03/22/2022 :  03:36:48  
Hi Gary

It seems that different hosts have different setups within cPanel for their PHP versions selector & using the default cPanel setup on the server caused the site not to show, I was left with a polar bear in a snow storm effect

A good while back I tried switching to PHP 8 & ended up with the site not visible & that was using the defaults. So, toward back end of '21 I revisited the issue on an ECT site but still had similar issue. So I started enabling the PHP extensions in cPanel & the site has worked fine ever since. I also read up on the various extensions on what they do, don't do & security issues etc to minimise my choices & not end up making a pigs ear.

I'm no server boffin as there appears no 'handbook' of definite do's, don'ts, maybes or maybenots. The only clients cPanel site that I do not host has zero PHP extension selector / choices, just a straight version change & their site will not show at all when switched to 8.0. That bridge will need crossing sooner than later!

The site where this all seems to function fine with has zero mod's add-ons, MagicZoom Plus & a customised contact form, other than that it is ECT 'out-of-the-box.

I have four screenshots of the setup that has been working fine since around last Sept. The current version of cPanel is
100.0.11 on LiteSpeed server. Hope some of this may help you Gary.

The ECT admin info


The cPanel PHP selector screens






-----------------------------------
Steve
Manchester UK

Make it as simple as possible, but not simpler.

Edited by - 1818charlie on 03/22/2022 04:04:31

Vince
Administrator

42692 Posts

Posted - 03/22/2022 :  04:35:52  
Because mySQLi is so fundamental to 99% of websites we can normally take for granted that it is enabled. Also, the database connection was always a user editable file to allow for different connections and that makes it difficult to update. But maybe the default connection should be as follows to check that mySQLi is actually defined before trying to connect...

if(!function_exists('mysqli_connect')){
die('<html><body>mySQLi is not enabled in PHP. Please contact your host.</body></html>');
}else{
$GLOBALS['ectdatabase'] = new mysqli($db_host, $db_username, $db_password, $db_name);
if(mysqli_connect_error()){
ob_clean();
print '<html><head><title>Database connect error</title><style>div{ margin:20px }</style></head>';
print '<body><div>Database Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error() . '</div>';
print '<div>You need to set your database connection in vsadmin/db_conn_open.php</div>';
print '<div>For help setting your database connection please see...<br />';
print '<a href="https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn" target="_blank">Database Connection Instructions</a></div>';
print '<div>We also have a support forum here...<br />';
print '<a href="https://www.ecommercetemplates.com/support/" target="_blank">Support Forum</a></div>';
die('</body></html>');
}
}

Vince


Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

ITZAP
Ecommerce Template Guru

Australia
1016 Posts

Posted - 03/22/2022 :  19:05:00  
That alteration to "db_conn_open.php" works well. Thanks Vince.

Gary

drivers
Ecommerce Template Expert

USA
890 Posts

Posted - 03/23/2022 :  12:49:25  
Where does this alteration go in db connection open?

When it gets late at night, go to bed... try again tomorrow.

Vince
Administrator

42692 Posts

Posted - 03/23/2022 :  14:10:00  
quote:
Where does this alteration go in db connection open?
The bit below where it says, "Don't edit below this line".

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

drivers
Ecommerce Template Expert

USA
890 Posts

Posted - 03/23/2022 :  14:16:47  
that would do it :) I feel like a criminal now <---

When it gets late at night, go to bed... try again tomorrow.

ITZAP
Ecommerce Template Guru

Australia
1016 Posts

Posted - 01/13/2023 :  19:27:19  
Please note that I applied the new alteration to the "db_conn_open.php" file (as recommended by Vince above) which checks that mySQLi is actually defined before trying to connect to the ECT store database.

In cPanel, when I updated to PHP VERSION 8.2 and accepted the Default Set of PHP Extensions applied, then visited my website, this Error Message was displayed:
quote:
mySQLi is not enabled in PHP. Please contact your host.


Editing the PHP v8.2 Extensions as follows solved the issue.

Disabled:
- memcache
- mysqli

Enabled:
- imagick
- memcached
- nd_mysqli
- opcache



Gary
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.01 seconds. Snitz Forums 2000