Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: file_exists() in admin/backup.php


michi

Recommended Posts

Posted

Hi,

 

I was getting a backup by the admin panel and got this warning:

 

Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/gzip) is not within the allowed path(s): (/home/httpd/vhosts/netaiki.com.br/httpdocs:/tmp) in /home/httpd/vhosts/netaiki.com.br/httpdocs/loja/admin/backup.php on line 424

 

Warning: file_exists(): open_basedir restriction in effect. File(/usr/local/bin/zip) is not within the allowed path(s): (/home/httpd/vhosts/netaiki.com.br/httpdocs:/tmp) in /home/httpd/vhosts/netaiki.com.br/httpdocs/loja/admin/backup.php on line 425

 

I chmod 777 the admin/backup directory to give permission to generate the backup but couldn't get it.

 

How can i do?

 

Thanks all!

  • 1 year later...
Posted
Hi,

 

I was getting a backup by the admin panel and got this warning:

I chmod 777 the admin/backup directory to give permission to generate the backup but couldn't get it.

 

How can i do?

 

Thanks all!

 

Hi

 

I found this message and don't seem to find an answer. I have the same message displayed on my admin/backup panel.

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/bin/gzip) is not within the allowed path(s): (/home/user/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/user/public_html/osc/admin/backup.php on line 424

 

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/local/bin/zip) is not within the allowed path(s): (/home/user/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/user/public_html/osc/admin/backup.php on line 425

 

Here belows are the lines 424 and 425 of backup.php:

if (file_exists(LOCAL_EXE_GZIP)) $contents[] = array('text' => '<br>' . tep_draw_radio_field('compress', 'gzip') . ' ' . TEXT_INFO_USE_GZIP);

if (file_exists(LOCAL_EXE_ZIP)) $contents[] = array('text' => tep_draw_radio_field('compress', 'zip') . ' ' . TEXT_INFO_USE_ZIP);

 

What are solutions to remove the top two error messages? Is the solution displayed somewhere in this forum? Can anyone show me where to look for the solution? It would be a great help.

 

BTW, I have already got admin/backups folder and it is storing the backup file.

 

Thanks in advance.

 

James Chan

Posted

This is a hosting problem caused by running PHP in Safe Mode. What it is telling you is that (/usr/bin/gzip) is in a place which it is not allowed to operate from when PHP is running in Safe Mode. Only your hosts can sort that one out.

 

Vger

  • 1 month later...
Posted
This is a hosting problem caused by running PHP in Safe Mode. What it is telling you is that (/usr/bin/gzip) is in a place which it is not allowed to operate from when PHP is running in Safe Mode. Only your hosts can sort that one out.

 

Vger

 

 

I have the same error and have forwarded the link to this thread to them.

I'll let you know how I get on!

 

Spot_on

Posted
I have the same error and have forwarded the link to this thread to them.

I'll let you know how I get on!

 

Spot_on

 

Well, my ISP says that safe mode if Off and

 

"I have checked with our engineers and the use of gzip/zip from scripts is not

supported on our servers."

 

So, can anyone advise further. Do I need to unzip things?

  • 1 month later...
Posted

If cut the 424 and 425 out, the error lines in admin/backup interface disappear.... but the option to save compressed database is lost too. If isn't a big store this will not be a problem.

 

Renato

  • 1 year later...
Posted

BTW, did you know that the name MICHI is a MAP played online for Age Of Empires THE CONQUERORS? Great game actually and great map :)

  • 4 weeks later...
Posted

code in backup.php only looks if the file/executable of gzip and zip exist to determine if you can zip or gzip backups. Unfortunately, the open_basedir stuff was invented after that and while the file exists it won't allow you to use it.

 

The remedy is to make sure backup.php thinks the file is not there. This is a bit hidden IMO, in admin/includes/application_top.php around line 40:

CODE

// Used in the "Backup Manager" to compress backups

define('LOCAL_EXE_GZIP', '/usr/bin/gzip');

define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');

define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');

define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

 

If you change it (I think this should work) you won't have the problem anymore:

CODE

// Used in the "Backup Manager" to compress backups

define('LOCAL_EXE_GZIP', 'gzip'); // originally: '/usr/bin/gzip');

define('LOCAL_EXE_GUNZIP', 'gunzip'); // originally '/usr/bin/gunzip');

define('LOCAL_EXE_ZIP', 'zip'); // originally: '/usr/local/bin/zip');

define('LOCAL_EXE_UNZIP', 'unzip'); // originally: '/usr/local/bin/unzip');

  • 2 years later...
Posted

code in backup.php only looks if the file/executable of gzip and zip exist to determine if you can zip or gzip backups. Unfortunately, the open_basedir stuff was invented after that and while the file exists it won't allow you to use it.

 

The remedy is to make sure backup.php thinks the file is not there. This is a bit hidden IMO, in admin/includes/application_top.php around line 40:

CODE

// Used in the "Backup Manager" to compress backups

define('LOCAL_EXE_GZIP', '/usr/bin/gzip');

define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');

define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');

define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

 

If you change it (I think this should work) you won't have the problem anymore:

CODE

// Used in the "Backup Manager" to compress backups

define('LOCAL_EXE_GZIP', 'gzip'); // originally: '/usr/bin/gzip');

define('LOCAL_EXE_GUNZIP', 'gunzip'); // originally '/usr/bin/gunzip');

define('LOCAL_EXE_ZIP', 'zip'); // originally: '/usr/local/bin/zip');

define('LOCAL_EXE_UNZIP', 'unzip'); // originally: '/usr/local/bin/unzip');

That did the trick for me, thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...