Update: Host Migration.
I’ve had too many reasons to migrate my company’s web hosting away from GoDaddy, so I finally pulled the trigger. Went to BlueHost, migrating now. I’m excited to work on this again after the migration.
Perhaps a note on your FAQ about GoDaddy limiting processing capabilities of WPDM would be a good addition. Knowing that early on would have been very helpful for me. ๐
Yea, the cache is maxed out.
It appears that GoDaddy hosting is just terrible, which I already knew. This is just another reason for me to migrate.
PHP runs in safe mode, so this causes a lot of issues with long ZipArchive processes. I tried every workaround: compressing on disk, compressing as temporary file on disk, increasing memory (php and apache) and timeouts, significant changes to .htaccess and php.ini, and more. I even did some hacks with Ajax, hoping a Ajax call would work around the timeouts.
Based on my research and everything I’ve tried, I’d say that GoDaddy hosting just isn’t a good fit for WPDM, or anything else for that matter. Since migration isn’t a possibility for us at this time, I am trying one last thing: Cron jobs.
I created a cron job script to refresh our zip packages, and I’m just integrating into WPDM now in the most basic way – a direct linked file. The Cron Jobs will handle the refreshing of the packages.
However, if it wasn’t for this, I could have finished my full integration. My next step was to add a div box for “Refreshable Packages” that would post the variable data (e.g. source path, destination path) to the DB, and a set of if conditions to handle the enabling/disabling of my features. I’m confident that my most recent script would work on a regular server.
I’ll let you know how the CRON Jobs go
Hey Shaon!
I’ve been making some progress with my extension for WPDM. I’ve gotten the integration about halfway there! I’m having some issues now with ZipArchive, and I was hoping I could bounce some ideas off you.
I’m working with a massive file/Folder-Structure for my Download Package. It’s over 6,500 files, 533 folders, and is 1.21gb or so uncompressed. My script works beautifully on smaller f/F-structures when I test it, but the entire Package is still too much. I first began hitting problems with the file handler limit, or u limit, and solved that. But now, it appears I have no conventional way around my php page time outs – it’s a Shared Hosting server problem. GoDaddy doesn’t allow me to set the timeout too far, and I can’t set ignore_user_abort either. Here is what I’ve done thus far:
-increased php mem to 1024mb
-reworked script to build archive on disk as local temp first, instead of building in memory
-created a method to ($zip->close; $zip->reopen) archive every 255 addfiles; to fix u limit (file handler limit) bug
-coupled addFromString(contents) with addFile(file) [somehow this gave me better results]
I think I’ve reached the limit of what I can do conventionally to solve the PHP-timeout on Massive f/F-structures. So, now I’m going to pursue unconventional means. I’m developing an idea to stream the ziparchive() operation to the browser, and then redirect to itself after (X) amount of loops. I’m planning on trying out ftell() and fseek(), and maybe an iFrame to accomplish this.
Paul Duncan has written a ZipArchive extension that seems to do this: http://pablotron.org/software/zipstream-php/
However, his code is much more extensive and heavy than I would like. I hope to develop a cleaner way to do it.
How familiar are you with this situation? Do you have any tricks already up your sleeve to counter PHP-timeout errors like this? Or perhaps any tips on streaming ZipArchive? I’ll begin work on streaming the script now, I’ll appreciate input of any kind.
Thanks Shaon!
OK- it took me first deleting the WP-Admin and WP-Includes folders and replacing them for it to fix itself.
The line I added must have needed to be registered or something
I’ll do some more plugin research to see what I’m missing.
[update:]
Making progress! I just got part of the integration working, looks like I just needed to dissect your code a bit more. I’ll let you know how the rest goes!
i’m thinking it might be a wp_enqueue_scripts issue. This is my first foray into WP plugins, and I believe I needed to register my new function.
hmm, it appears the forum is removing a good chunk of the code. attached is a TXT file