Now that you intend to develop for PrestaShop, you are better off keeping all your development work on your machine. The main advantage is that it makes it possible for you to entirely bypass the process of uploading your file on your online server in order to test it. Another advantage is that a local test environment enables you to test code without the risk of breaking your production store. Have a local environment is the essential first step in the path of web development.
PrestaShop needs the following server configuration in order to run:
PrestaShop can also work with Microsoft’s IIS Web server 6.0 or later, and nginx 1.0 or later.
Installing any web-application locally requires that you first install the adequate environment, namely the Apache web server, the PHP language interpreter, the MySQL database server, and ideally the phpMyAdmin tool. This is called an *AMP package: Apache+MySQL+PHP and the operating system, giving WAMP (Windows+Apache+MySQL+PHP), MAMP (Mac OS X+…) and LAMP (Linux+…). Since all of the items packaged are open-source, these installers are most of the time free.
Here is a selection of free AMP installer:
PrestaShop needs a few additions to PHP and MySQL in order to fully work. Make sure that your PHP configuration has the following settings and tools:
allow_url_fopen enabled. The
allow_url_fopen directiveenables 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.
Here is a section of the
php.ini file (the configuration file for PHP):
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
You can download the latest version of PrestaShop at http://www.prestashop.com/en/downloads.
You can download the (unstable) development version on Github: https://github.com/PrestaShop/PrestaShop/archive/develop.zip.
Extract the PrestaShop files, and put them in the root folder of the AMP installer you chose:
Open the phpMyAdmin tool using your browser. Its location depends on the AMP pack you chose:
In the “Databases” tab, indicate the database name you want and validate by clicking on the “Create a database” button.
Open the PrestaShop installer, which should be located at http://127.0.0.1/prestashop/install, and follow its instructions.
You can read the Getting Started guide for more details: http://doc.prestashop.com/display/PS17/Getting+Started.
Once your module is online, its files could be accessed by anyone from the Internet. Even if they cannot trigger anything but PHP errors, you might want to prevent this from happening.
You can achieve this by adding an
index.php file at the root of any module folder you create. Here is a suggestion for what to put in the file.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Location: ../"); exit;