Page 1 of 1
Opencart v4 - Unable to rename admin directory?
Posted: Thu Jun 16, 2022 1:43 pm
by jfnz
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?
Re: Opencart v4 - Unable to rename admin directory?
Posted: Thu Jun 16, 2022 11:40 pm
by straightlight
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.
Re: Opencart v4 - Unable to rename admin directory?
Posted: Fri Jun 17, 2022 4:10 am
by by mona
I found this useful ..
viewtopic.php?t=228495&p=843586
BTW - Which browser did you install OC on?
Re: Opencart v4 - Unable to rename admin directory?
Posted: Mon Jun 20, 2022 5:00 pm
by penaw35811
Thanks this is working......
....
Re: Opencart v4 - Unable to rename admin directory?
Posted: Tue Jun 21, 2022 1:38 am
by gauravsh8790
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.
Re: Opencart v4 - Unable to rename admin directory?
Posted: Tue Jun 21, 2022 8:08 pm
by by mona
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) {
Re: Opencart v4 - Unable to rename admin directory?
Posted: Thu Jun 23, 2022 3:53 am
by Gukkie
Do i delete the entire admin folder after i create a new admin?