Child pages
  • Setting up your local development environment

Versions Compared

Key

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

...

  • GD library.
  • Dom extension.
  • allow_url_fopen enabled.

Here is a section of the php.ini file (the configuration file for PHP):

Code Block
extension = php_mysql.dll
extension = php_gd2.dll
allow_url_fopen = On
    
# also recommended
register_globals = Off
magic_quotes_gpc = Off
allow_url_include = Off
Note

The GD library (http://www.boutell.com/gd/) enables PrestaShop to rework images that you upload, especially resizing them.

The Dom extension enables to parse XML documents. PrestaShop uses it for various functionalities, like the Store Locator. It is also used by some modules, as well as the pear_xml_parse library.

The allow_url_fopen directive enables modules to access remote files, which is an essential part of the payment process, among others things. It is therefore imperative to have it set to ON.

...

You can download the latest version of PrestaShop at http://www.prestashop.com/en/downloads.

Info

The downloaded file is an archive, meaning one file containing all of PrestaShop's files in compressed form. In order to continue with the process, you must uncompress the archive.

If your operating system does not natively support Zip files, you can download and install a dedicated tool, such as:

You can download the development version (unstable) on Github: https://github.com/PrestaShop/PrestaShop/archive/master.zip

Extract the PrestaShop files, and put them in the root folder of the AMP installer you chose:

...

Creating a database for your local shop

To use PrestaShop, you must create a database where your shop will put its data:

Open the phpMyAdmin tool using your browser. Its location depends on the AMP pack you chose:

Click In the "Databases" tab, put your wanted database name in the field and validate by clicking on the "Create a database" button in the "Databases" tab.

Installing PrestaShop

Open the PrestaShop installer, which should be located at http://127.0.0.1/prestashop, and follow the instructions.

...

Warning

Forcing the compilation of Smarty will always slow down the page loading time of the page. Make sure that your production store is set to only recompile the templates if there are updated files, and that its cache is enabled.

...

PrestaShop's default settings prevent the client to see any server error message or any debugging code.

...

PrestaShop has custom debug methods available for developers: p($variable) and d($variable). They are used to display the content of a variable. It is really a wrapper around the well-known print_r() method (http://php.net/manual/en/function.print-r.php):

Code Block
titleThe p() method
echo '<xmp style="text-align: left;">';
print_r($variable);
echo '</xmp><br />';
return $variable;

...

p() is the main method, and d() works the same way, except that it calls the die() method instead of returning the variable:

Code Block
titleThe d() method
echo '<xmp style="text-align: left;">';
print_r($variable);
echo '</xmp><br />';
die('END');

These two methods enable you to check for the state of a given variable at a specific space place within your code.

On top of that, PrestaShop defines the ppp() and ddd() method, which are respectively the aliases of p() and d(). They work exactly the same, but are often easier to search and find in a huge block of code.

...

There are three main configuration files, all located in the /config folder:

  • config.inc.php
  • defines.inc.php
  • smarty.inc.php

...

$smarty->debugging gives access to Smarty debug information when displaying a page. That setting is more easily modified in the "Performance" page of the advanced parameters menu : the "Debug console" option enables you to choose between never displaying Smarty's debug information, always displaying it, or only displaying it when you add ?SMARTY_DEBUG to the URL of the page you want to test, which can be very useful.

Warning

When in production mode, $smarty->force_compile must be set to "false", as it will give a 30% boost to your page load time.

On the other hand, when editing a .tpl file, you must delete the /tools/smarty/compile folder (except the index.php file) in order to see your changes applied.

Note that this setting can be made directly from the back-office, in the "Performance" page under the "PreferencesAdvanced parameters" menu.