We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4310
    • 2,310 Posts
    Got it working on a couple of sites one one web host but am having problems on a different host.
    Everything works until I get to:
    Start PclZip archive of all files to /var/www/vhosts/mydomain.com/httpdocs/backup/archive/srww_bkup_20080614_230446.zip . . .

    after about 10 seconds the browser progress bar gets to the end but no .zip file is produced.
    I’ve tried increasing the time and MB to 600 and 256, no change.
    Any guidance?
    Initially PHP was running in safe mode, but I got the host to switch it to off.
      • 4310
      • 2,310 Posts
      Tried with a small folder and got this :
      Start MySQL backup of mydb_yso to backup/tmp/mydb_yso.sql . . . Completed MySQL backup. - Size: 1118160
      
      Start FileList . . . File count: 17 . . Completed FileList.
      
      Start PclZip archive of all files to /var/www/vhosts/mydomain.com/httpdocs/backup/archive/srww_bkup_20080614_231219.zip . . . Completed PclZip backup. - Size: 458035
      
      Start Delete of /var/www/vhosts/mydomain.com/httpdocs/backup/tmp/* files . . . Deleted tmp/mydb_yso.sql size 1118160 . . .
      Warning: unlink(tmp/mydb_yso.sql) [function.unlink]: Permission denied in /var/www/vhosts/mydomain.com/httpdocs/backup/bkup_class.php on line 472
      Completed Delete of /var/www/vhosts/mydomain.com/httpdocs/backup/tmp/* files
      
      Backup process complete...

      When I download it I can’t unzip, it reports : Invalid or corupt file
        • 5274
        • 177 Posts
        Quote from: bunk58 at Jun 14, 2008, 10:35 PM

        Warning: unlink(tmp/mydb_yso.sql) [function.unlink]: Permission denied in /var/www/vhosts/mydomain.com/httpdocs/backup/bkup_class.php on line 472
        Completed Delete of /var/www/vhosts/mydomain.com/httpdocs/backup/tmp/* files
        


        Permission denied on a file operation is almost always is a file ownership issue. Make sure the permissions are set correctly on the file in question AND the tmp/ directory. Since this is happening late in the process on the delete function I suspect that’s not the issue but you never know. Also the unlink command is only available on PHP 4 & 5. Hopefully that’s not the issue either. The corrupt zip might be the PHP zlib settings. Do a phpinfo and let me know what the zlib settings are. If none of those help, do you have access to the raw Apache logs? There might be more details on the errors.
          • 4310
          • 2,310 Posts
          zlib
          ZLib Support 	enabled
          Stream Wrapper support 	compress.zlib://
          Stream Filter support 	zlib.inflate, zlib.deflate
          Compiled Version 	1.2.3
          Linked Version 	1.2.3
          
          Directive	Local Value	Master Value
          zlib.output_compression	Off	Off
          zlib.output_compression_level	-1	-1
          zlib.output_handler	no value	no value
          

          CHMOD settings are : tmp/ directory is 775 mydb_yso.sql is 777
          PHP 5.2.5
          The only significant difference between the two hosts are that the problematic one has Suhosin Extension 0.9.23 running.
          Could it be that?
            • 5274
            • 177 Posts
            Quote from: bunk58 at Jun 15, 2008, 09:05 AM

            CHMOD settings are : tmp/ directory is 775 mydb_yso.sql is 777
            PHP 5.2.5
            The only significant difference between the two hosts are that the problematic one has Suhosin Extension 0.9.23 running.
            Could it be that?

            Try the tmp/ directory set to 777. That is most likely the cause. If I run with /tmp set to 775 on my setup if fails too.

            There’s nothing alarming in the Zlib settings. I’m not familiar with the Suhosin Extension so I can’t help there.
              • 4310
              • 2,310 Posts
              Thanks Chuck, changing the tmp/ folder to 777 cured the error.
              However when I try to zip a larger set of folders it just stalls at
              Start PclZip archive of all files to /var/www/vhosts/mydomain.com/httpdocs/backup/archive/srww_bkup_20080614_231219.zip 

              It seems to attempt to create the 25MB zip, but when downloaded it’s invalid/corrupt,
              presumably this is running out of time/memory even though the config is set to 600 seconds and 256 MB ?
                • 5274
                • 177 Posts
                A corrupt zip file usually means the zip process was terminated before completion. I have 2 suggestions. If you think it’s a memory issue then in order to have no memory limit set the value to -1. If it fails do it again since the server conditions may have changed enough to allow the process to run properly. The other way is to break up the backup on that server into 2 different configs. While 25MB is not large it sounds like this is a shared server that maybe close to capacity. Makes me think the next release needs to allow multiple config files for different types of backups?
                  • 4310
                  • 2,310 Posts
                  When you say
                  in order to have no memory limit set the value to -1
                  where do you mean?
                  I’ve tried it as both
                  seconds = -1

                  and
                  megabytes = -1
                  but still no usable zip file.
                    • 5274
                    • 177 Posts
                    The -1 is acceptable to PHP for maximum memory, not the seconds. I’m not sure what is going on with that site. There must be a host setting that is preventing the script from working but without more information from the Apache error logs I don’t think we can do much more.

                    EDIT: Try to exclude the archive directory from the backup process otherwise you’re asking the zip process to include the file its building. That can be done with the config file listing out specific directories or another way is to setup the archive directory outside the webspace by using a relative path in the config like: ../archive/
                      • 4310
                      • 2,310 Posts
                      Tried moving the archive folder and excluding the backup folder to no avail.
                      Must be some setting at this host.
                      I’ll see if I can get hold of the error logs.