php abouts on your server

Is your php working?

Used Text Editor: Netbeans

Note: make a “new folder” under  wamp/www.

1. Create ProjectName:
File->New Project->select PHP->next->Project name: info_php,  Source Folder:  browse new folder you created on under wamp/www.  Finish

2. Make a new php file. Right click on info_php . Give a file name , say Php_info

3. Add php info function.

<?php
phpinfo();
?>

4. Check it on browser:  http://localhost/info_php/php_info.php

Note: Quick test to make sure if php is running or not.  It also shows the information about php in your web server.

 

Installing Wamp and Setting up MySQL

PLATFORM: WINDOWS

To begin:

  1. Download wamp package : www.wampserver.com/en/index.php

-During installation:

*Browse For Folder – Select “www” (this is where php file will go) and click OK
*SMTP server-localhost
*Default

Note: This will download Apache, mysql and php.

2. Start all services of wamp server ( Find wamp icon and click on Start all services).

3. Start MySQL Console- Click wamp icon from taskbar. Select->  MySQL ->  MySQL Console

-Prompts ->   Enter password:  [ *by default its blank so just hit enter]

[ If you want to set up a root password  :  (Type as shown below)

use  mysql [-shows Database Changed]
update mysql.user SET password=password(“YOUR_NEW_Password”) [ hit enter]
where user=”root”; [hit enter]
[Shows Query OK]

flush Privileges;
[shows Query OK]
quit [hit enter]

NOTE: Now start your MySQL console, you are now required to enter your new password.

4. Install Text Editor Netbeans or Dreamweaver or Zend Studio or Komodo Edit

Note: we are using netbeans. http://www.netbeans.com/downloads/index.html
[ click on download  that says PHP in a column]

5. Test if the web server is running or not.

On your browser (iexplorer/firefox/chrome)  ->   http://localhost/

Unix/Linux Ownership and Permissions – Part 1 – whoami

whoami

Unix/Linux is a multi-user operating system. It is very important to understand the concept of how user accounts work in order to use any Unix/Linux system effectively. In an Unix environment, you define the access to any file by granting permissions to users. The term ‘user’ in Unix simply refers to someone who has an account in the Unix system thereby allowing him or her to access the system.

You need to understand that:

  • A user has full access to their own files (files created by them).
  • But, limited access to other users’ files.

To check who you are logged in as, you’ll need to use the command whoami. The output of this command will be the user id of the user you are logged in as.

whoami

Output of a whoami command

In the picture above, you can see that output of the whoami command is the user id named parash.

Every user in Unix/Linux environment has a home directory. To find the path to your home directory, you would type the command echo $HOME.

echo $HOME

find path to user's home directory

In the picture above, the output of the echo $HOME command is the path to the user’s home directory i.e /Users/parash.
In Unix/Linux system, $HOME refers to the environment variable that stores the path to a user’s home directory.