Jump to content

Developing on your own machine


tallinn

Recommended Posts

Hi.

There is a PrestaShop hosted by a hosting company which I am to develop for.

I am pretty new to PrestaShop and was wondering how I could create a development environment on my own laptop so I can develop new features locally and then deploy them to the server?

 

Regards

Link to comment
Share on other sites

Yes. That I get. And I have XAMPP on my machine.

 

Maybe I am not phrasing the question correctly.

 

I am following this guide: http://doc.prestashop.com/display/PS16/Setting+Up+Your+Local+Development+Environment

 

It tells me to download the PrestaShop from a link. As I understand it, that is a default barebones PrestaShop intended for people who are starting from scratch. I, on the other hand, am not starting from scratch. I am starting with an already developed PrestaShop by someone else. 

 

Now I have gotten access to the server where it is hosted and have downloaded the files to my computer.

 

So what I need to know is how to start developing for that PrestaShop instead of creating a new from scratch.

 

 

A side question. How large is a typical PrestaShop in bytes? The one I have is suspiciously large.

Link to comment
Share on other sites

I suggest that you go to your cPanel File Manager, select all the PrestaShop files and then click the "Compress" button to create a ZIP of all your files. Download this file and then extract it to a subdirectory (such as C:\xampp\htdocs\prestashop if you're using XAMPP). You should then go to your cPanel phpMyAdmin and then click the Export tab. Select all the PrestaShop tables and then export them as a ZIP. Go to http://localhost/phpmyadmin and then click the Import tab and then select your database ZIP to import the PrestaShop database tables. If done correctly, you'll have an exact copy of your PrestaShop installation on your localhost.

 

It's hard to say exactly how big PrestaShop should be. PrestaShop's Smarty cache and CCC cache can become quite large and so can the /img directory if it has many product images.

Link to comment
Share on other sites

Hi Tallinn,

 

Depending on your current level of skills (command line, VM, networking, apache, .. ), I strongly suggest having a look at Vagrant.

 

Always try to develop on a server corresponding as much as possible to the production environment.

MAMP/XAMP/WAMP is really not the way to go.

Link to comment
Share on other sites

rocky, I appreciate your help but could you be a bit more verbal in descriping the different steps? 
What is the cPanel File Manager?

I have downloaded all the PrestaShop files through SFTP and I currently have them uncompressed in my "c:\xampp\htdocs\<nameofwebsite>\<nameofwebsite2>"  folder.

 

I have also installed the PrestaShop module for Xampp using Bitnami. 

When I navigate to "http://10.0.0.9/prestashop/" it displays the default PrestaShop website. I am not sure how I can load up my website there.

 

I am guessing I also need to replicate the database somehow.

 

prestaKing.eu, Thanks for the tip. Once I get Xampp running I will take a look at that. Currently, I just want the bare minimum to work. That being the current version of the website to run on my machine.

Thanks!

Edited by tallinn (see edit history)
Link to comment
Share on other sites

Yes. Now we are getting somewhere.

So basically what I have done is:

1. Install XAMPP and run Apache as well as MySQL.

2. Download all the files and folders from my hosting provider onto my computer.

3. Created a backup of the database from the manager console and downloaded that backup.

4. Imported the database into my local MySQL database naming the database X.

5. Moved all of the files and folders from step 2. to "C:\xampp\htdocs\projects\prestatest\X\Y"

 

Now if I navigate to "localhost/projects/prestatest/X/Y"  then I get this error message "Link to database cannot be established: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known."
Which suggests that it can not establish a connection to the database. 

Are there any config files for each PrestaShop that have basic configuration? 
When installing a new PrestaShop the installation procedure takes care of setting these for us during installation but I would like to manually change it.

 

Progress :)

Link to comment
Share on other sites

I found the "settings.inc.php" file in the config folder. It had the name of the database, name of the server, username, and password. They were all different of course so I changed them to what I have on my local machine.


I realize that this will have to be changed back to what it was if I upload it to the production environment. But I will not do that yet. My goal here is to get it working and then make a new one where I have all the steps required and then it will be close to the production environment.

Link to comment
Share on other sites

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...