Unix

How to install extension php?

$ sudo apt-get install extension_name
The above command install the specified extension in unix/linux box.

How to install intl extension php?

$ sudo apt-get install php5-intl

How to install PHP accelerator APC?

sudo apt-get install php-apc

The extension already installed then it will upgrade if any new version released.

If no latest version release after our installation then it show message like below

$ sudo apt-get install php-apc
[sudo] password for sasikala:
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-apc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 404 not upgraded.

How to check particular php extension installed in linux?

This command shows the extension installed or not
$ php --re extensionname

example :
$ php --re intl
Exception: Extension intl does not exist

If exists then display the extension like below with version and its contents

Extension [
extension #46 intl version 1.1.0 ] {

- INI {
Entry [ intl.default_locale ]
Current = ''
}
Entry [ intl.error_level ]
Current = '0'
}
}

- Constants [171] {
Constant [ integer INTL_MAX_LOCALE_LEN ] { 80 }
Constant [ string INTL_ICU_VERSION ] { 4.8.1.1 }
......
....
.....
....

How to find which php is used or where the php located in command line?

$Which php
this command show the path of the php used.

Example:
$ which php
/usr/bin/php

How to find which php.ini used in console?

php -i display the phpinfo(). Grep that result and find the php.ini file like below

$ php -i | grep Config
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Configuration

Unix interview / Learning Questions

23.If a directory contains public files which should not be altered,the most liberal permissions that can be given to the directory is
Ans 755

24. After the following command is executed
$ ln old new

a listing is performed with the following output

$ ls -li

total 3

15768 -rw-rw-rw- 2 you 29 Sep 27 12:07 old
15768 " " " " " " " " new
15274 " " 1 " 40 " " 09:34 veryold

which of the following is true

a)old and new have same i-node number,2
b) " " " " " " " , 15768
c)old and new have nothing yo do with each other
d)very old and new are linked
e)very old and old are linked

Ans: old and new have same i-node number, 15768

25. The command ......ln /bin/mail /usr/you/bin/m

a)will not be executed because you are linking files across different file systems
b)results ln /bin/mail being the same file as /usr/you/bin/m
c)results in 2 links to the file mail
d) " " " " m
e)none

Ans: b

26. In a standard directory lay out, /etc is the directory where

a) basic programs such as who and ed reside

b)various administrative files such as password file reside

Ans: b

27. The UNIX system call that transforms an executable binary file into

a process is
a)execl()
b)execv()
c)execle()
d)execve()
e)All of the above

Ans : d

Unix - Questions - Interview / Learning

13. What does chmod 654 stand for.

Ans : _rw_r_xr__

14. Which of following is used for back-up files?

(a) compress (b) Tar (c) make (d) all the above

Ans : b

15. what does find command do ?

Ans : search a file

16. The very first process created by the kernal that runs till the kernal process is haltes is

Ans : init

17. The UNIX shell is....

Ans : forms the interface between the user and the kernal

18. In UNIX a files i-node
Ans : is a data structure that defines all specifications of a file like the file size ,number of lines to a file ,permissions etc.

19. Which of the following is true

a)UNIX is a time sharing multi-user OS
b)UNIX has a device independent file system
c)UNIX is full duplex
d)UNIX has command interpreter
e)All of the above

Ans: e

20. Interprocess communication in UNIX can be achieved using

a)pipe
b)Message
c)Semaphores
d)Shared Memory
e)All of the above

Ans : e

21. Which of the following is true about fork()

Ans : causes the creation of a new process ,the CHILD process with a new process ID

22. until who|grep mary
do
sleep 60
done
a) is syntactically incorrect
b) waits 60 seconds irrespective of Mary being logged in or not
c) waits until Marry is logged in
d)waits till Mary exited
e)None

Ans : c

Syndicate content