Jump to content

V1.0: Download and unpack prestashop on remote server without SSH in seconds (saves long FTP sessions)


Recommended Posts

Hi,

prestashop is great! And installing it via SSH console is very fast and comfortable. But what if you don't have SSH?

If you have a webhosting package without SSH access you have to download the prestashop zip-file, unzip it to your harddisk and then upload it via ftp to your remote server - very boring!

As an alternative you can use the following script to save some time (especially if you have a slow upload connection).

You have to upload the script (I call it downloader.php) in the directory where the shop should be installed. After uploading you run the script in your browser (e.g.http:///downloader.php, if the script is in your domain root dir) and let the script do the rest.

It will:
- download the zip-archive
- unzip it
- do some clean-up

In the end your directory should look the same as after a long ftp session (transfering every single file from your hdd).

This script has been successfully tested with 1&1;and domain factory accounts and should work with other hosters as well. But it comes with absolutely no warranty - USE AT YOUR OWN RISK.

<?php
/*
** downloader.php
**
** It downloads the prestashop zip-file and unpacks it 
**
** Instructions:
** - Upload this file to the (root) directory of your domain
** - Run it from the browser (http:///downloader.php)
**
** Works fine on 1&1;and domainfactory servers 
** (should work with other hosters as well)
** After completion this file will be deleted (for security reasons)
**
** @author: Heiko Thurat, http://www.medianetix.de
** Distribution allowed, but leave the author message intact.
**
*/

$version = 'prestashop_1.0';
$download = $version . '.zip';
$presta_dir = $version;
$filename = basename(__FILE__);

echo '<html><head><title>Prestashop v1.0 installation</title></head>';
echo '<body><h3>Prestashop installation';

$cmd = array();
$cmd[] = "wget http://www.prestashop.com/download/$download";
$cmd[] = "unzip $download";
$cmd[] = "mv $presta_dir/* .";
$cmd[] = "rmdir $presta_dir";
$cmd[] = "rm -f $download";

foreach($cmd as $c) {
 printf('%s%s', $c, "\n");
 system($c);
}

unlink(__FILE__);
echo "done. $filename has been removed for security reasons!</body></html>";
exit;
?>




Have fun!

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...