Post by jfnz » Thu Jun 16, 2022 1:43 pm

Opencart v4.0.0 on an AWS Lightsail instance running Amazon Linux 2. Fresh install.

Everything works and installs cleanly, however I get the warning about needing to move the "admin" directory. Inputting a new name in the field and hitting the button does literally nothing.

Attempting to delve in to the command line, I edited admin/config.php and renamed the HTTP/HTTPS URL "define" statements and the "DIR_APPLICATION', DIR_OPENCART" variable. Following this I renamed the "admin" folder to "<newname>" and however I get SQL errors after this attempting to auth as an admin.

Any pointers on how I either fix the GUI error of doing absolutely nothing, or otherwise edit configs, etc. to resolve this?

Newbie

Posts

Joined
Wed Jun 15, 2022 1:28 pm

Post by straightlight » Thu Jun 16, 2022 11:40 pm

jfnz wrote:
Thu Jun 16, 2022 1:43 pm
Opencart v4.0.0 on an AWS Lightsail instance running Amazon Linux 2. Fresh install.

Everything works and installs cleanly, however I get the warning about needing to move the "admin" directory. Inputting a new name in the field and hitting the button does literally nothing.

Attempting to delve in to the command line, I edited admin/config.php and renamed the HTTP/HTTPS URL "define" statements and the "DIR_APPLICATION', DIR_OPENCART" variable. Following this I renamed the "admin" folder to "<newname>" and however I get SQL errors after this attempting to auth as an admin.

Any pointers on how I either fix the GUI error of doing absolutely nothing, or otherwise edit configs, etc. to resolve this?
I would still wait a bit before using OC 4 with AWS Lightsail. It might still be a bit soon. As for the SQL errors, please post your server error logs.

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 by mona » Fri Jun 17, 2022 4:10 am

I found this useful ..
viewtopic.php?t=228495&p=843586

BTW - Which browser did you install OC on?

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by penaw35811 » Mon Jun 20, 2022 5:00 pm

by mona wrote:
Fri Jun 17, 2022 4:10 am
I found this useful ..
viewtopic.php?t=228495&p=843586

BTW - Which browser did you install OC on?
Thanks this is working..........

Newbie

Posts

Joined
Mon Jun 20, 2022 4:22 pm

Post by gauravsh8790 » Tue Jun 21, 2022 1:38 am

Hi,

go to admin->common->controller and open security.php.
at line 260 find where is written : foreach (glob(trim($next, '/') . '/{*,.[!.]*,..?*}', GLOB_BRACE) as $file) and replace trim with rtrim or replace code with
foreach (glob(rtrim($next, '/') . '/{*,.[!.]*,..?*}', GLOB_BRACE) as $file) .

thanks.

Newbie

Posts

Joined
Tue Jun 21, 2022 1:31 am

Post by by mona » Tue Jun 21, 2022 8:08 pm

The original was written more clearly

viewtopic.php?t=228495
Post by Qphoria » Wed May 25, 2022 1:52 am
After installing 4.0, there is an attempt to move files from "admin" to "newadmin" that doesn't work on my server.
I've tracked down the issue to this line (found twice in the admin/controller/common/security.php file):

Code: Select all

foreach (glob(trim($next, '/') . '/{*,.[!.]*,..?*}', GLOB_BRACE) as $file) {
If I change it to this, it works fine but I'm not an expert on all the GLOB options so it may or may not be complete. In any case, it seemed to work for me

Code: Select all

foreach (glob($next . '/{*,.[!.]*,..?*}', GLOB_MARK|GLOB_BRACE) as $file) {
But while it does copy and move to "newadmin" it did not seem to auto-delete the original "admin" folder so there may be another issue with that.


OPTION TWO
Post by gauravsh8790 » Mon Jun 20, 2022 6:38 pm

Code: Select all

foreach(glob(rtrim($next, '/') . '/{*,.[!.]*,..?*}', GLOB_BRACE) as $file) {

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by Gukkie » Thu Jun 23, 2022 3:53 am

Do i delete the entire admin folder after i create a new admin?

Newbie

Posts

Joined
Mon Apr 25, 2016 9:35 pm
Who is online

Users browsing this forum: No registered users and 3 guests