Child pages
  • System Administrator Guide

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order for PrestaShop 1.5.x to run properly, your PHP installation must feature the following settings and libraries:

  • MySQL (or Percona Server, see "Improving PrestaShop's performances" section below).
  • GD library.
  • Dom extension.
  • allow_url_fopen.

The MySQL extension enables to access your data. PrestaShop simply cannot work without it.
You can also use the drop-in replacement Percona Server, which offers better performance than the standard MySQL server.

The GD library enables PHP to dynamically manipulate images. PrestaShop uses it to resize and rework the image files that are uploaded (watermarking, trimming, etc.). Without images, an online shop loses most of its interest, so make sure that GD is enabled!

...

The magic_quotes directive automatically escapes (or "adds antislashes", see http://php.net/manual/en/function.addslashes.php ) to all special character sequences (', ", \, NULL) for all environment variables (GET, POST, COOKIE, SERVER...). This option must be set to OFF because it will addslash each variable even if it does not need to be addslashed. Moreover, some Web applications overlook this option, so some variables could be addslashed twice, resulting in corrupted data.

...

MySQL often has an administrator account as default ("root", "admin", ...), which gives access to all of the databases' content, no matter who the database is managed by. The administrator has all the rights, and can do every possible action. You therefore need to safekeep your databases, so as to prevent your web applications from succumbing to SQL injections (which can happen when a user succeeds in obtaining the admin password, read http://en.wikipedia.org/wiki/SQL_injection).

Warning

If you just installed MySQL, do add a password for the root account, who which has no password as default.

...

This file contains logins and hashed password who are allowed to access to the folder.
To hash password, you can use usea  .htpasswd file generator: http://aspirine.org/htpasswd_en.html.

...

Here are a few tips that should enable you to optimize PrestaShop.

...

Improving PHP performance

Whenever possible, use an opcode cache (or ask your web host to install one for you), in order to alleviate the server's processing load.

...

Opcode means "operation code", and defines the compiled state of the dynamic files, which can processed faster.
PrestaShop is compatible with eAccelerator (http://eaccelerator.net/).

Improving MySQL performance

Misc. improvements

If possible, split your static elements betweens different domains and sub-domains, in order to get parallel HTTP connexions. To put that in place, open the /config/defines.inc.php file and add these lines (adapted to your needs):

Code Block
languagephp
if ( $_SERVER['REMOTE_ADDR'] != '127.0.0.1' )
{
  define( '_THEME_IMG_DIR_',   'http://img2.xxx.com/'       );
  define( '_THEME_CSS_DIR_',   'http://css.xxx.com/'        );
  define( '_THEME_JS_DIR_',    'http://js.xxx.com/'         );
  define( '_THEME_CAT_DIR_',   'http://img1.xxx.com/c/'     );
  define( '_THEME_PROD_DIR_',  'http://img1.xxx.com/p/'     ); 
  define( '_THEME_MANU_DIR_',  'http://img1.xxx.com/m/'     ); 
  define( '_PS_IMG_',          'http://img1.xxx.com/'       ); 
  define( '_PS_ADMIN_IMG_',    'http://img1.xxx.com/admin/' ); 
} else { 
  define( '_THEME_IMG_DIR_',   _THEMES_DIR_ . _THEME_NAME_ . '/img/' ); 
  define( '_THEME_CSS_DIR_',   _THEMES_DIR_ . _THEME_NAME_ . '/css/' ); 
  define( '_THEME_JS_DIR_',    _THEMES_DIR_ . _THEME_NAME_ . '/js/'  ); 
  define( '_THEME_CAT_DIR_',   __PS_BASE_URI__ . 'img/c/'            ); 
  define( '_THEME_PROD_DIR_',  __PS_BASE_URI__ . 'img/p/'            ); 
  define( '_THEME_MANU_DIR_',  __PS_BASE_URI__ . 'img/m/'            ); 
  define( '_PS_IMG_',          __PS_BASE_URI__ . 'img/'              ); 
  define( '_PS_ADMIN_IMG_',    _PS_IMG_.'admin/'                     ); 
}

A list of tips & tricks is also available on our site:

Nginx friendly URLs

Most of the server instructions in this page pertain to the Apache web server. But some of you might prefer to rely on the Nginx web server. PrestaShop works well with Nginx, but is not able to generate the correct redirection rules for its Friendly URLs.

...