Support Forums - Classified Ads Script Osclass

General osclass questions => Report bug => Topic started by: Mindaugas on April 13, 2023, 10:31:04 AM

Title: Error data backup in Tools->Backup data
Post by: Mindaugas on April 13, 2023, 10:31:04 AM
Impossible create backup of files witch dashboard tools for backup. Tool show message "Archived successfully!", but archive not created and debug get next error:

[13-Apr-2023 10:33:22 Europe/Vilnius] PHP Warning:  ZipArchive::close(): Can't open file: Permission denied in /var/www/html/domain.xx/oc-includes/osclass/utils.php on line 1413

Apache error log file:

[Thu Apr 13 10:33:22.799339 2023] [php7:warn] [pid 77931] [client 87.247.90.129:48552] PHP Warning:  ZipArchive::close(): Can't open file: Permission denied in /var/www/html/domain.xx/oc-includes/osclass/utils.php on line 1413, referer: https://www.domain.xx/oc-admin/index.php?page=tools&action=backup

Directory permision is 755
File perminsion is 644
Owner www-data:www-data
Osclass version: 8.1.1
PHP version: 7.4.3

What could be wrong?

Title: Re: Error data backup in Tools->Backup data
Post by: MB Themes on April 13, 2023, 12:00:31 PM
Maybe you do not have correct permissions in root folder that does not allow create archive here?
That would be first what I would check
Title: Re: Error data backup in Tools->Backup data
Post by: Mindaugas on April 13, 2023, 03:22:17 PM
Permissions of root dir (/var/www/html/<domain>) is:
Access: (0755/drwxr-xr-x)  Uid: (   33/www-data)   Gid: (   33/www-data)

It seems to me that permissions of root dir are good.

Where else could there be a mistake?
Title: Re: Error data backup in Tools->Backup data
Post by: MB Themes on April 19, 2023, 01:40:21 PM
Try to set 0755 chmod for all folders and subfolders.
Title: Re: Error data backup in Tools->Backup data
Post by: Mindaugas on April 19, 2023, 04:01:00 PM
nothing helps, I tried to make permissions 777 for all, 755 for dir and 644 for file, same error  :(
Title: Re: Error data backup in Tools->Backup data
Post by: MB Themes on April 19, 2023, 04:40:49 PM
Last what comes to my mind is to test ZIP function manually on your site, that you create small script and try to run it, if it can zip.
Title: Re: Error data backup in Tools->Backup data
Post by: Mindaugas on April 23, 2023, 03:21:17 PM
The compression function in the terminal works, php-zip is installed. The reason remains unclear, but it seems to be related to OS and PHP. The situation was resolved when the migrated from VPS to hosting.
Title: Re: Error data backup in Tools->Backup data
Post by: MB Themes on April 26, 2023, 01:43:03 PM
Interesting, there could be relation between chmod - zip - php, but some of these settings are even hidden and usually just hostiing can help to resolve.