Post by paradoxx » Sun Sep 02, 2018 7:42 am

Hi everyone,

I migrated my shop to a better hosting offer within my Hosting provider. My problem now is that the shop is extremely slow, sometimes the customers get a Bad Gateway error or simply takes ages to load.

I contacted the support and they told me that is because the PHP that Im using (5.6.36) is not working well with the new server. They recommended me to upgrade PHP. If I set another PHP Version inside Plex, like 7.2.9, the Shop is automatically dead. White page on Frontend and backend.
After setting it again back, I selected PHP 7 and there only the backend worked, the frontend is gone.

On my old server was running pretty good without any changes, now on this server I have been optimizin several stuff to make it faster but nothing, Im losing sales.

Do you guys have any Idea on how to know what is slowing down the server? Could it really be a incompatibility with PHP that is causing this?

Here are some errors that I took out from the logs:

1. (32)Broken pipe: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

2. mod_fcgid: stderr: PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in

For point #2 I changed the config files to run with mysqli, but when I change it for Admin, the backend is not loading, I get only a white site. I have no idea why is not working like the frontend.

If you guys have any clue, I would appreciate your help.

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am

Post by IP_CAM » Sun Sep 02, 2018 9:44 am

1. Remove / Disable all the VqMod Extensions, since one of them might hinder OC to work on PHP 7.x
2. Upload the two system/.... Files, contained in the ZIP File enclosed, to make OC v.1.5.6.x work with PHP-7.x
3. Set BOTH config.php File Lines to : define('DB_DRIVER', 'mysqli'); ONLY!
4. If you want to newly install OC, use the PHP-7.x Install Code, but FIRST change the Links in the two Files, as shown in the image enclosed.
5. Some VqMod Extensions and/or Modules might no longer function with PHP v.7.x.
----
STILL, under normal circumstances, there is no remarkable slow-down with v.1.5.6.x,
if it run's under PHP v.5.6.x, compared to PHP v.7.x, just to have this mentioned too.
Good Luck! ;)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Sun Sep 02, 2018 8:21 pm

A bit overthought about the encryption class. This solution could also be used: viewtopic.php?f=198&t=204707&p=725370#p725077

In case the required openssl_random_pseudo_bytes() function has not been instantiated on your server: https://stackoverflow.com/questions/112 ... eudo-bytes .

However,
AES256-CTR provides only unauthenticated encryption, which is almost never what you want. You need authenticated encryption.
Source: https://crypto.stackexchange.com/questi ... -correctly

In addition, providing bcrypt solutions can also create password leaks as I do not suggest using it with any of the AES-256 algorithm: https://security.stackexchange.com/ques ... ion-vector
You don't process the password. Right now, if a ciphertext gets leaked, I could just go ahead and try to brute-force the user's password, because you deployed no counter-measures to password guessing (like using bcrypt).

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paradoxx » Tue Sep 04, 2018 4:53 am

Thank you both for your answers, I really really appreciate your help.
I'm replicating the shop in a VM so I can try your suggestions there without sweating it ;)

Ernie, now that you mentioned the DB driver, I had that once changed to mysqli and when I set both config files to mysqli, the front end works, but the backend does not, just plain white.

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am

Post by IP_CAM » Tue Sep 04, 2018 5:05 am

Well, then leave the Admin Section running under mysql, as long as it does, and start
to disable your Modules and VqMods, until you're down to a more or less default Admin.
Then, you might find out, where it blocks the Admin from further Access, if Admin starts
to function with PHP 7.
STILL, you better try a PHP 7.0.x or 7.1.x Version first, before you start to work on this.
Good Luck!
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by paradoxx » Tue Oct 16, 2018 4:04 pm

Hi, just coming back for an update.

In the end, it was not about my PHP version, opencart Version or even the mysql driver. It was about the amount of ram that the provider had on this new "improved" server. From my point of view a very rookie performance. They installed more ram on that thing and the shop is running like before.
Either way I did some of the solutions you guys gave me so I have improved :)

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am
Who is online

Users browsing this forum: Amazon [Bot] and 76 guests