When you start customizing your Magento store, a good development environment with the following components saves time:
A code editor (IDE)
A MySQL client (phpMyAdmin or MySQL Workbench)
A command-line tool
NetBeans is an open source IDE that can be used for a lot of programming languages. The PHP support is well maintained and there are a lot of integrations with other systems (Git, SVN, and MySQL).
To install NetBeans, you have to download it from their site at http://netbeans.org and run the installer. Make sure that when you download it, you select the PHP version or the full version.
The following steps show you how to create a NetBeans project with the Magento files as the document root:
To create the project, open NetBeans and navigate to File | New Project.
In the dialog window, click on PHP Application with Existing Sources as shown in the following screenshot:
Click on Next and configure the following settings:
The following screenshot gives the sample values for these settings:
Tip
When you are working with a version control system (SVN, Git, or something else), it is recommended to check the option Put NetBeans metadata into a separate directory. If not checked, a
.nbproject
folder is created in your Magento root, which you will not have in your version control system. Another possibility is to add the.nbproject
folder in the.gitignore
file.Click on Next.
Configure the following settings:
Run as: In our case, this field is set to a local web server
Project URL: In this field, enter
http://magento-dev.local
, the URL that we have configured for MagentoIndex File: This field is set to
index.php
The following screenshot gives the sample values for these settings:
Click on Finish and your NetBeans project is ready.
When the project is started, you see the document root in the left-hand side column of the window. When you double click on a file, the file will open in the main window. In this window, you can view the file's history, format the code, refactor variable names, and a lot more.
Behind the development environment in the IDE, a database client and a command-line tool are very useful when developing in Magento.
phpMyAdmin is a MySQL client that runs as a web application. It is an easy-to-use tool for direct SQL input in a database.
To install phpMyAdmin, open your terminal and run the following command:
sudo apt-get install phpmyadmin
Follow the installer's instructions.
Edit the
/etc/apache2/apache.conf
file, and add the following code at the end of the file:Include /etc/phpmyadmin/apache.conf
Reload the Apache server with the following command:
sudo service apache2 reload
Go to
http://magento-dev.local/phpmyadmin
, and you will see the login screen. You can log in with the credentials of the database user for your Magento database.
Magento has a lot of system tasks that you have to execute in your development process. All these actions could be triggered in the backend. However, because this is a time consuming job, a shell interface can save you a lot of time.
Wiz is a command-line tool that you can download from https://github.com/classyllama/Wiz.
Follow the installation instructions on their website. When installed, you have to change the directory of your shell to your Magento root. If you are in the Magento root, all the commands you run are executed for that Magento installation.
The following are some useful commands:
wiz admin-resetpass
: This command can be used when you forget your admin passwordwiz admin-createadmin
: This command creates a new administrative user from scratchwiz cache-clear
: This command clears all cache or specific cachewiz devel-showhints
: This command enables or disables frontend hintswiz module-list
: This command gives a list of all the installed modules