Unzipping on the server?
-
oddcarl
- Regular
- Posts: 27
- Joined: Mon Nov 13, 2006 5:53 am
- Location: The Barbary Coast of California
Unzipping on the server?
Wondering if the Serendipity zip file can be uploaded to the server and then unzipped using that cpanel feature? That would be great because Serendipity program has gotten large.
Thanks..oddcarl
Thanks..oddcarl
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Unzipping on the server?
Hi!
If cpanel can unzip a file, sure, it should work without a problem
Regards,
Garvin
If cpanel can unzip a file, sure, it should work without a problem
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Either I repack it with the appropriate directory name on a local computer, or I do something like:
Code: Select all
// Extract into temporary directory
system("unzip -d /tmp myfile.zip");
// Copy to my blog
system("cp -R /tmp/serendipity/* /htdocs/blog");
// Remove the tmp file
system("rm -rf /tmp/serendipity");
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
As stm9x9 says, you've got to copy all the files. You can either:
- download the archive to a local machine, unarchive it locally, and upload the files with an FTP client
- upload the archive to the remote machine and use a custom PHP script to unarchive it
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Do you have an idea, what to do if the hoster does not allow "system", "passthrough" etc? Is there a php-variante for this all?judebert wrote:Either I repack it with the appropriate directory name on a local computer, or I do something like:Code: Select all
// Extract into temporary directory system("unzip -d /tmp myfile.zip");
Ciao, Stephan
-
williamts99
- Regular
- Posts: 30
- Joined: Sat Dec 10, 2005 11:50 pm
- Contact:
If you can get SSH access to your host you can use that to transfer, rename, decompress the zip file, and rename if you must. You also might want to look into using the wget command that way you can download the zip from the hosting server directly to your server. That saves you a ton of time as there is nothing faster then server to server transfers.
It takes me about 3 seconds to download the zip file by using the command:
wget http://prdownloads.sourceforge.net/php- ... p?download
^that is all one line
then another 3 seconds to unzip using
unzip serendipity-1.1.2.zip
which will unzip all of the files into the serendipity/ directory and if the files exist it will ask if you want to overwrite and give you the option of yes/no/All/None/Rename
That is about it, and of course this could all be automated.
Edit: I figured I would post a very simple php script that would do this all automatically, pretty crude without any options, buttons, variables etc, but it will get the job done for you automatically, s9y will be extracted to the serendipity/ directory where ever you put the script and will overwrite any files that exist in the serendipity directory. Copy and paste it into a file named install.php or whatever then upload to desired directory and run by visiting the page.
It takes me about 3 seconds to download the zip file by using the command:
wget http://prdownloads.sourceforge.net/php- ... p?download
^that is all one line
then another 3 seconds to unzip using
unzip serendipity-1.1.2.zip
which will unzip all of the files into the serendipity/ directory and if the files exist it will ask if you want to overwrite and give you the option of yes/no/All/None/Rename
That is about it, and of course this could all be automated.
Edit: I figured I would post a very simple php script that would do this all automatically, pretty crude without any options, buttons, variables etc, but it will get the job done for you automatically, s9y will be extracted to the serendipity/ directory where ever you put the script and will overwrite any files that exist in the serendipity directory. Copy and paste it into a file named install.php or whatever then upload to desired directory and run by visiting the page.
Code: Select all
<?php
// This PHP command will download the ZIP file
system('wget http://prdownloads.sourceforge.net/php-blog/serendipity-1.1.2.zip?download');
// Then this PHP command will unzip the downloaded files while overwriting exisiting files
system('unzip -o serendipity-1.1.2.zip');
// And finally this PHP command will remove the downloaded zip file
system('rm serendipity-1.1.2.zip');
?>PHP has some zip functions, but I don't know how to use them, I'm afraid. It looks like they're cooking up something really nice, but it's only in CM right now.stm999999999 wrote:Do you have an idea, what to do if the hoster does not allow "system", "passthrough" etc? Is there a php-variante for this all?