Hi guys, long time no see! Today, I come back with series of tutorials that help you setup development environment for Magento projects.
I suppose to divide the series into 4 parts:
- Part 1: Setup basic web development environment: apache2, php5, mysql.
- Part 2: Install some popular tools for Magento development: modman, n98-magerun.
- Part 3: Install some other popular tools for Magento development: phpStorm & its awesome plugin Magicento.
- Part 4: Git and some approaching development models for Magento Projects.
OK. Let's start with the work of setting up basic web development environment.
The original package of Ubuntu 14.0 have not contained apache2 yet. So, you need to install it first. Open you Terminal and install package through amazing command apt-get.
sudo apt-get update
sudo apt-get install apache2
Open your browser, go to localhost or 127.0.0.1
If you can see this screen, it means the apache has been installed successfully!
sudo apt-get install mysql-server php5-mysql
During the installation process, you must select some options and provide root password for mysql. Take it easy, it is so quick.
To test the result, open your terminal and try this command:
mysql -u root -p
After that, input your mysql root password, you will come to mysql script panel in terminal where you can execute every sql command.
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
To test the result, first of all, you must restart apache2
sudo service apache2 restart
In the local storage, your localhost locates in var/www/html. You can use function phpinfo() to test all of work:
sudo nano var/www/html/phpinfo.php
The content of this file is only:
Press Ctrl + 0 to write out, press ENTER to confirm name of file, press Ctrl + X to quit nano editor.
Go to address localhost/phpinfo.php in your web browser. If you see the window such as the following image that means php5 is successfully installed in your Ubuntu.
That's all! Good luck and have fun!