Page 1 of 1

Moving from Shared hosting to Ubuntu VPS

Posted: Mon Apr 07, 2025 12:54 am
by oursupersoftware
Hi,

I'm moving my OC installation from shared linux hosting package to a Ubuntu VPS that I have configured myself. I'm using php7.4.

I am really struggling to get OC to work again because of this error:
index.php error:

Code: Select all

Unknown: Creation of dynamic property Request::$request is deprecated in /var/www/mydomain/system/library/request.php on line 26
apache error logs:

Code: Select all

[php:warn] [pid 11593] [client ipaddress:58467] PHP Warning:  fopen(var/www/mydomain/storage/logs/error.log): Failed to open stream: No such file or directory in /var/www/mydomain/system/library/log.php on line 22
[php:error] [pid 11593] [client ipaddress:58467] PHP Fatal error:  Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, false given in /var/www/mydomain/system/library/log.php:31\nStack trace:\n#0 /var/www/mydomain/system/library/log.php(31): fwrite()\n#1 /var/www/mydomain/system/framework.php(46): Log->write()\n#2 /var/www/mydomain/system/library/request.php(26): {closure}()\n#3 /var/www/mydomain/system/framework.php(70): Request->__construct()\n#4 /var/www/mydomain/system/startup.php(104): require_once('...')\n#5 /var/www/mydomain/index.php(19): start()\n#6 {main}\n  thrown in /var/www/mydomain/system/library/log.php on line 31
[php:error] [pid 11593] [client ipaddress:58467] PHP Fatal error:  Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resource, false given in /var/www/mydomain/system/library/log.php:39\nStack trace:\n#0 /var/www/mydomain/system/library/log.php(39): fclose()\n#1 [internal function]: Log->__destruct()\n#2 {main}\n  thrown in /var/www/mydomain/system/library/log.php on line 39
I have tried so many commands to get the permissions for the storage directory to work and I have had no success. I even tried a fresh install and I get the same error.

Here is my config.php DIR paths if it helps:

Code: Select all

define('DIR_APPLICATION', '/var/www/mydomain/catalog/');
define('DIR_SYSTEM', '/var/www/mydomain/system/');
define('DIR_IMAGE', '/var/www/mydomain/image/');
define('DIR_STORAGE', 'var/www/mydomain/storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');
I would really appreciate any guidance on how to fix this issue.

Re: Moving from Shared hosting to Ubuntu VPS

Posted: Mon Apr 07, 2025 3:41 am
by ADD Creative
One of your issues is that you are not using the PHP version you think you are. "Creation of dynamic property Request" errors only happen in PHP 8.2 and above.

Re: Moving from Shared hosting to Ubuntu VPS

Posted: Mon Apr 07, 2025 4:45 am
by oursupersoftware
ADD Creative wrote:
Mon Apr 07, 2025 3:41 am
One of your issues is that you are not using the PHP version you think you are. "Creation of dynamic property Request" errors only happen in PHP 8.2 and above.
Your were 100% correct, but now I'm getting a issue with cache:
Apache Logs:

Code: Select all

PHP Fatal error:  Uncaught Error: Class 'Twig\\Loader\\ArrayLoader' not found in /var/www/mydomain/system/library/template/twig.php:31\nStack trace:\n#0 /var/www/mydomain/system/library/template.php(51): Template\\Twig->render()\n#1 /var/www/mydomain/system/engine/loader.php(125): Template->render()\n#2 /var/www/mydomain/catalog/controller/common/language.php(45): Loader->view()\n#3 /var/www/mydomain/system/engine/action.php(79): ControllerCommonLanguage->index()\n#4 /var/www/mydomain/system/engine/loader.php(48): Action->execute()\n#5 /var/www/mydomain/catalog/controller/common/header.php(74): Loader->controller()\n#6 /var/www/mydomain/system/engine/action.php(79): ControllerCommonHeader->index()\n#7 /var/www/mydomain/system/engine/loader.php(48): Action->execute()\n#8 /var/www/mydomain/catalog/controller/common/maintenance.php(25): Loader->controller()\n#9 /var/www/mydomain/system/engine/action.php(79): Contr in /var/www/mydomain/system/library/template/twig.php on line 31
Website error:

Code: Select all

Warning: fopen(var/www/mydomain/storage/cache/cache.catalog.language.1743978444): failed to open stream: No such file or directory in 
/var/www/mydomain/system/library/cache/file.php on line 49Warning: flock() expects parameter 1 to be resource, bool given in 
/var/www/mydomain/system/library/cache/file.php on line 51Warning: fwrite() expects parameter 1 to be resource, bool given in 
/var/www/mydomain/system/library/cache/file.php on line 53Warning: fflush() expects parameter 1 to be resource, bool given in 
/var/www/mydomain/system/library/cache/file.php on line 55Warning: flock() expects parameter 1 to be resource, bool given in 
/var/www/mydomain/system/library/cache/file.php on line 57Warning: fclose() expects parameter 1 to be resource, bool given in 
/var/www/mydomain/system/library/cache/file.php on line 59Warning: fopen(var/www/mydomain/storage/cache/cache.currency.1743978444): failed to open stream: No 
such file or directory in /var/www/mydomain/system/library/cache/file.php on line 49Warning: flock() expects parameter 1 to be resource, bool given in /var/www/mydomain/system/library/cache/file.php on line 51Warning: fwrite() expects parameter 1 to be 
resource, bool given in /var/www/mydomain/system/library/cache/file.php on line 53Warning: fflush() expects parameter 1 to be 
resource, bool given in /var/www/mydomain/system/library/cache/file.php on line 55Warning: flock() expects parameter 1 to be 
resource, bool given in /var/www/mydomain/system/library/cache/file.php on line 57Warning: fclose() expects parameter 1 to be 
resource, bool given in /var/www/mydomain/system/library/cache/file.php on line 59Warning: fopen(var/www/mydomain/storage/logs/error.log): failed to open stream: No such file or directory in 
/var/www/mydomain/system/library/log.php on line 22
I have no clue why it's doing this.

I managed to login to OC Admin, I tried refreshing cache in Extensions>Modifications and also in Dashboard>Developer Setting but I still get this error.

I made sure to copy over the existing working storage directory and contents, but no success so far.

Re: Moving from Shared hosting to Ubuntu VPS

Posted: Mon Apr 07, 2025 5:49 am
by oursupersoftware
I managed to fix the issue, my config.php was missing a / for my storage directory.

Re: Moving from Shared hosting to Ubuntu VPS

Posted: Tue Apr 15, 2025 4:11 pm
by khnaz35
You can add word [SOLVED] in the very first post title.