Friday, March 5, 2010

Basic Ubuntu OS Command for Working PHP application

Start Up:
When i started working on the ubuntu machine(i.e march 2nd 2010) i am little scared & tensed..but now it seems cool & great... :)

Now i am not providing all command which ubuntu support.

New Buddies like me want to work on ubuntu machine similary to windows machine.
My Problems on Ubuntu & Solution:

Note :When you logged into ubuntu machine your not root user to the machine so you use SUDO command to perform operations(read/write/create/execute).

1)Unable to find terminal?
Ans: Click on Application->system tools->terminal
2)Unable to minimize all windows opened using keyboard?
Ans: Press ctrl+alt+d keys
3)Navigation of windows using keyboard?
Ans: Press alt+Tab keys
4)Unable to create (php,html,js)files etc using vi command in terminal?
Ans: Use Text Editor for create/write/read files and to enable highlighting code in the Text Editor,first open Text Editor and click on the edit menu ->perferences->enable php code
5)Configuration xampp server??
Ans:
XAMPP for Linux Download – http://www.apachefriends.org/en/xampp-linux.html
Pre-Installation

By now, you should have already downloaded the following file:

1. xampp-linux-1.7.1.tar.gz

Note: Unless you know what you’re doing, it’s recommended that you’re using the same files to avoid any confusion. If, for example, when newer versions are released, simply type in the correct file name when installing in the “Install XAMPP”.

Now, this tutorial is done on a Linux system (Ubuntu), not Windows. Remember earlier when I told you the tools I’d use are all free? Well, Ubuntu is an excellent alternative operating system to Windows! Give it a try, you may like it!
Install XAMPP

We install XAMPP by extracting its content to a folder named “opt”:

1. Locate the file xampp-linux-1.7.1.tar.gz you’ve just downloaded.
2. If it’s not on your Desktop, move the file there use cd ~ command Press enter.
3. Open the Terminal, enter the following command:

sudo tar xvfz Desktop/xampp-linux-1.7.1.tar.gz -C /opt
Start XAMPP

You installed XAMPP in the previous section, now it’s time to start it:

1. Open the Terminal, enter the following command:

sudo /opt/lampp/lampp start

You should see the following lines in the terminal if everything is done correctly:

XAMPP: Starting Apache with SSL (and PHP5)…
XAMPP: Starting MySQL…
XAMPP: Starting ProFTPD…
XAMPP for Linux started.

Test XAMPP

Okay, so how do you know if XAMPP is currently active?

1. Open your favourite web broswer.
2. Enter the following address:

http://localhost.
It will open XAMPP Start Up Page.
Ans:
6)Mail Configuration in Ubuntu?
Ans:Install sendmail server in ubuntu machine
7)Execution php files in the XAMPP?
Ans:Use following commands:
[username@localhost ~]$cd / press enter
[username@localhost ~]$cd /opt/lampp/htdocs/ press enter
[username@localhost ~]$sudo mkdir examples press enter
[username@localhost ~]$sudo chmod 777 examples press enter
Now Go to filesystem (root/opt/lampp/htdocs/examples) and create php file(i.e test.php) in the folder.
Next Step:
browser the link http://localhost/examples/test.php

No comments:

Post a Comment