Database Restore Error - Warning: chmod()
Permalink
Hi everyone,
I recently moved my website from localhost MAMP server to a live webserver and when I restored the database from the backup I made, I received the following errors:
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 93
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 120
in the backup.php file I believe lines 93 and 120 are:
Line 93: chmod(DIR_FILES_BACKUPS . '/'. $file, 0666);
Line 120: chmod(DIR_FILES_BACKUPS . '/'. $file, 000);
Any advice on understanding this and correcting this error would be appreciated.
Thank you
-concreteart
I recently moved my website from localhost MAMP server to a live webserver and when I restored the database from the backup I made, I received the following errors:
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 93
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 120
in the backup.php file I believe lines 93 and 120 are:
Line 93: chmod(DIR_FILES_BACKUPS . '/'. $file, 0666);
Line 120: chmod(DIR_FILES_BACKUPS . '/'. $file, 000);
Any advice on understanding this and correcting this error would be appreciated.
Thank you
-concreteart
Hello,
I did try changing the permissions to 755 for all directories in the chain to the backup.php file and received the same error. I just try it again right now, and got the same errors again:
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 93
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 120
However, the top directory "/" directory is "xxx" > followed by /domains set to 755 on down to backup.php file.
I did try changing the permissions to 755 for all directories in the chain to the backup.php file and received the same error. I just try it again right now, and got the same errors again:
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 93
Warning: chmod() [function.chmod]: Operation not permitted in .../public_html/concrete/core/controllers/single_pages/dashboard/system/backup_restore/backup.php on line 120
However, the top directory "/" directory is "xxx" > followed by /domains set to 755 on down to backup.php file.
Anyone?
I'd really like to correct this error so I do not run into problems with my website. So if anyone has come across these errors before, I'd really appreciate your guidance on this.
Thank you.
I'd really like to correct this error so I do not run into problems with my website. So if anyone has come across these errors before, I'd really appreciate your guidance on this.
Thank you.
Just throwing a few ideas about here...
If 755 permissions don't resolve it, could it be a case of ownership? Web servers are usually set up so that any file uploaded by FTP or created by the web site is owned by Apache, so preventing such issues.
Also maybe check is if the web server php environment is set up to disallow use of the chmod function. Its not something I have come across, but shared host php environments are often setup to disallow functions that may lead to security issues, and maybe this host is a bit over enthusiastic.
You could try running php info and see if it lists anything that gives a clue.
If 755 permissions don't resolve it, could it be a case of ownership? Web servers are usually set up so that any file uploaded by FTP or created by the web site is owned by Apache, so preventing such issues.
Also maybe check is if the web server php environment is set up to disallow use of the chmod function. Its not something I have come across, but shared host php environments are often setup to disallow functions that may lead to security issues, and maybe this host is a bit over enthusiastic.
You could try running php info and see if it lists anything that gives a clue.
With FTP or the command line for your server, you can check the /backups directory permissions and if not already set, try setting the directory permissions to 755 or 777. 755 is more secure, but which you need all depends on how the server is set up.
If you have just uploaded a clone of your site, you may need to do similar for the rest of the /files directory and subdirectories. You can test whether you need that by uploading a file with the c5 filemanager.
Another part of the site that may need such attention is /packages to allow new packages to install. You can test that first by trying to install any innocuous free addon.