Skip to content

Commit

Permalink
https://github.com/opencart/opencart/issues/1869
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel kerr committed Sep 30, 2014
1 parent c4ac514 commit b446c02
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 90 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
/upload/system/download/*
!/upload/system/download/index.html

# Upload Files
/upload/system/upload/*
!/upload/system/upload/index.html

!/upload/data/index.html

# Flags
Expand Down
158 changes: 80 additions & 78 deletions install.txt
Original file line number Diff line number Diff line change
@@ -1,79 +1,81 @@
/////////////////////////////////
/// OpenCart V2.0.x ///
/// Install Instructions ///
/// http://www.opencart.com ///
/////////////////////////////////


NOTE: THIS IS FOR NEW INSTALL ONLY!
IF UPGRADING YOUR EXISTING CART, BE SURE TO READ THE UPGRADE.TXT FILE INSTEAD


-------
INSTALL
-------
These instructions are for a manual installation using FTP, cPanel or other web hosting Control Panel.

- Linux Install -

1. Upload all of the files and folders to your server from the "Upload" folder, place them in your web root. The web root is different on some servers, cPanel it should be public_html/ and on Plesk it should be httpdocs/.

2. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php

3. For Linux/Unix make sure the following folders and files are writeable.

chmod 0755 or 0777 system/cache/
chmod 0755 or 0777 system/logs/
chmod 0755 or 0777 system/download/
chmod 0755 or 0777 image/
chmod 0755 or 0777 image/cache/
chmod 0755 or 0777 image/catalog/
chmod 0755 or 0777 config.php
chmod 0755 or 0777 admin/config.php

If 0755 does not work try 0777.

4. Make sure you have installed a MySQL Database which has a user assigned to it
DO NOT USE YOUR ROOT USERNAME AND ROOT PASSWORD

5. Visit the store homepage e.g. http://www.example.com or http://www.example.com/store/

6. You should be taken to the installer page. Follow the on screen instructions.

7. After successful install, delete the /install/ directory from ftp.


- Windows Install -

1. Upload all the files and folders to your server from the "Upload" folder. This can be to anywhere of your choice. e.g. /wwwroot/store or /wwwroot

2. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php

3. For Windows make sure the following folders and files permissions allow Read and Write.

system/cache/
system/logs/
system/download/
image/
image/cache/
image/catalog/
config.php
admin/config.php

4. Make sure you have installed a MySQL Database which has a user assigned to it
DO NOT USE YOUR ROOT USERNAME AND ROOT PASSWORD

5. You should be taken to the installer page. Follow the on screen instructions.

6. After successful install, delete the /install/ directory.



- Local Install -

There are many all-in-one web servers out there and most of them should work with OpenCart out of the box. Some examples...

http://www.apachefriends.org/en/xampp.html
http://www.ampps.com/
http://www.usbwebserver.net
/////////////////////////////////
/// OpenCart V2.0.x ///
/// Install Instructions ///
/// http://www.opencart.com ///
/////////////////////////////////


NOTE: THIS IS FOR NEW INSTALL ONLY!
IF UPGRADING YOUR EXISTING CART, BE SURE TO READ THE UPGRADE.TXT FILE INSTEAD


-------
INSTALL
-------
These instructions are for a manual installation using FTP, cPanel or other web hosting Control Panel.

- Linux Install -

1. Upload all of the files and folders to your server from the "Upload" folder, place them in your web root. The web root is different on some servers, cPanel it should be public_html/ and on Plesk it should be httpdocs/.

2. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php

3. For Linux/Unix make sure the following folders and files are writeable.

chmod 0755 or 0777 system/cache/
chmod 0755 or 0777 system/logs/
chmod 0755 or 0777 system/download/
chmod 0755 or 0777 system/upload/
chmod 0755 or 0777 image/
chmod 0755 or 0777 image/cache/
chmod 0755 or 0777 image/catalog/
chmod 0755 or 0777 config.php
chmod 0755 or 0777 admin/config.php

If 0755 does not work try 0777.

4. Make sure you have installed a MySQL Database which has a user assigned to it
DO NOT USE YOUR ROOT USERNAME AND ROOT PASSWORD

5. Visit the store homepage e.g. http://www.example.com or http://www.example.com/store/

6. You should be taken to the installer page. Follow the on screen instructions.

7. After successful install, delete the /install/ directory from ftp.


- Windows Install -

1. Upload all the files and folders to your server from the "Upload" folder. This can be to anywhere of your choice. e.g. /wwwroot/store or /wwwroot

2. Rename config-dist.php to config.php and admin/config-dist.php to admin/config.php

3. For Windows make sure the following folders and files permissions allow Read and Write.

system/cache/
system/logs/
system/download/
system/upload/
image/
image/cache/
image/catalog/
config.php
admin/config.php

4. Make sure you have installed a MySQL Database which has a user assigned to it
DO NOT USE YOUR ROOT USERNAME AND ROOT PASSWORD

5. You should be taken to the installer page. Follow the on screen instructions.

6. After successful install, delete the /install/ directory.



- Local Install -

There are many all-in-one web servers out there and most of them should work with OpenCart out of the box. Some examples...

http://www.apachefriends.org/en/xampp.html
http://www.ampps.com/
http://www.usbwebserver.net
http://www.wampserver.com/en/
6 changes: 3 additions & 3 deletions upload/admin/controller/tool/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function delete() {
$upload_info = $this->model_tool_upload->getUpload($upload_id);

if ($upload_info && is_file(DIR_DOWNLOAD . $upload_info['filename'])) {
unlink(DIR_DOWNLOAD . $upload_info['filename']);
unlink(DIR_UPLOAD . $upload_info['filename']);
}

$this->model_tool_upload->deleteUpload($upload_id);
Expand Down Expand Up @@ -270,7 +270,7 @@ public function download() {
$upload_info = $this->model_tool_upload->getUploadByCode($code);

if ($upload_info) {
$file = DIR_DOWNLOAD . $upload_info['filename'];
$file = DIR_UPLOAD . $upload_info['filename'];
$mask = basename($upload_info['name']);

if (!headers_sent()) {
Expand Down Expand Up @@ -389,7 +389,7 @@ public function upload() {
if (!$json) {
$file = $filename . '.' . md5(mt_rand());

move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file);
move_uploaded_file($this->request->files['file']['tmp_name'], DIR_UPLOAD . $file);

// Hide the uploaded file name so people can not link to it directly.
$this->load->model('tool/upload');
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/controller/tool/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function index() {
if (!$json) {
$file = $filename . '.' . md5(mt_rand());

move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file);
move_uploaded_file($this->request->files['file']['tmp_name'], DIR_UPLOAD . $file);

// Hide the uploaded file name so people can not link to it directly.
$this->load->model('tool/upload');
Expand Down
17 changes: 11 additions & 6 deletions upload/install/controller/step_2.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function index() {
$data['text_version'] = $this->language->get('text_version');
$data['text_global'] = $this->language->get('text_global');
$data['text_magic'] = $this->language->get('text_magic');
$data['text_upload'] = $this->language->get('text_upload');
$data['text_file_upload'] = $this->language->get('text_file_upload');
$data['text_session'] = $this->language->get('text_session');
$data['text_global'] = $this->language->get('text_global');
$data['text_db'] = $this->language->get('text_db');
Expand Down Expand Up @@ -87,6 +87,7 @@ public function index() {
$data['cache'] = DIR_SYSTEM . 'cache';
$data['logs'] = DIR_SYSTEM . 'logs';
$data['download'] = DIR_SYSTEM . 'download';
$data['upload'] = DIR_SYSTEM . 'upload';
$data['image'] = DIR_OPENCART . 'image';
$data['image_cache'] = DIR_OPENCART . 'image/cache';
$data['image_data'] = DIR_OPENCART . 'image/catalog';
Expand Down Expand Up @@ -162,6 +163,14 @@ private function validate() {
$this->error['warning'] = 'Warning: Logs directory needs to be writable for OpenCart to work!';
}

if (!is_writable(DIR_SYSTEM . 'download')) {
$this->error['warning'] = 'Warning: Download directory needs to be writable for OpenCart to work!';
}

if (!is_writable(DIR_SYSTEM . 'upload')) {
$this->error['warning'] = 'Warning: Upload directory needs to be writable for OpenCart to work!';
}

if (!is_writable(DIR_OPENCART . 'image')) {
$this->error['warning'] = 'Warning: Image directory needs to be writable for OpenCart to work!';
}
Expand All @@ -173,11 +182,7 @@ private function validate() {
if (!is_writable(DIR_OPENCART . 'image/catalog')) {
$this->error['warning'] = 'Warning: Image catalog directory needs to be writable for OpenCart to work!';
}

if (!is_writable(DIR_SYSTEM . 'download')) {
$this->error['warning'] = 'Warning: Download directory needs to be writable for OpenCart to work!';
}


if (!$this->error) {
return true;
} else {
Expand Down
2 changes: 2 additions & 0 deletions upload/install/controller/step_3.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function index() {
$output .= 'define(\'DIR_IMAGE\', \'' . DIR_OPENCART . 'image/\');' . "\n";
$output .= 'define(\'DIR_CACHE\', \'' . DIR_OPENCART . 'system/cache/\');' . "\n";
$output .= 'define(\'DIR_DOWNLOAD\', \'' . DIR_OPENCART . 'system/download/\');' . "\n";
$output .= 'define(\'DIR_UPLOAD\', \'' . DIR_OPENCART . 'system/upload/\');' . "\n";
$output .= 'define(\'DIR_MODIFICATION\', \'' . DIR_OPENCART . 'system/modification/\');' . "\n";
$output .= 'define(\'DIR_LOGS\', \'' . DIR_OPENCART . 'system/logs/\');' . "\n\n";

Expand Down Expand Up @@ -59,6 +60,7 @@ public function index() {
$output .= 'define(\'DIR_IMAGE\', \'' . DIR_OPENCART . 'image/\');' . "\n";
$output .= 'define(\'DIR_CACHE\', \'' . DIR_OPENCART . 'system/cache/\');' . "\n";
$output .= 'define(\'DIR_DOWNLOAD\', \'' . DIR_OPENCART . 'system/download/\');' . "\n";
$output .= 'define(\'DIR_UPLOAD\', \'' . DIR_OPENCART . 'system/upload/\');' . "\n";
$output .= 'define(\'DIR_LOGS\', \'' . DIR_OPENCART . 'system/logs/\');' . "\n";
$output .= 'define(\'DIR_MODIFICATION\', \'' . DIR_OPENCART . 'system/modification/\');' . "\n";
$output .= 'define(\'DIR_CATALOG\', \'' . DIR_OPENCART . 'catalog/\');' . "\n\n";
Expand Down
2 changes: 1 addition & 1 deletion upload/install/language/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$_['text_version'] = 'PHP Version';
$_['text_global'] = 'Register Globals';
$_['text_magic'] = 'Magic Quotes GPC';
$_['text_upload'] = 'File Uploads';
$_['text_file_upload'] = 'File Uploads';
$_['text_session'] = 'Session Auto Start';
$_['text_db'] = 'Database';
$_['text_mysqli'] = 'MySQLi';
Expand Down
11 changes: 10 additions & 1 deletion upload/install/view/template/step_2.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</td>
</tr>
<tr>
<td><?php echo $text_upload; ?></td>
<td><?php echo $text_file_upload; ?></td>
<td><?php if ($file_uploads) { ?>
<?php echo $text_on; ?>
<?php } else { ?>
Expand Down Expand Up @@ -314,6 +314,15 @@
<?php } ?>
</td>
</tr>
<tr>
<td><?php echo $upload . '/'; ?></td>
<td><?php if (is_writable($upload)) { ?>
<span class="text-success"><?php echo $text_writable; ?></span>
<?php } else { ?>
<span class="text-danger"><?php echo $text_unwritable; ?></span>
<?php } ?>
</td>
</tr>
<tr>
<td><?php echo $image . '/'; ?></td>
<td><?php if (is_writable($image)) { ?>
Expand Down
Empty file added upload/system/upload/index.html
Empty file.

0 comments on commit b446c02

Please sign in to comment.