Sunday 24 January 2016

Run Php - xampp in linux

How to run xampp php code in ubuntu:
------------------------------------
In this case you need to be root to start/stop LAMPP and to execute PHP code in it.

step:1
To become root just open the terminal and type the following command
(To avoid conflict stop lampp using this cmd $ /opt/lampp/lampp stop)
$sudo -i (Ntow the system by default as root. In older version ask password)


step:2
$cd /

step:3
ls

step:4
start lampp
$ /opt/lampp/lampp start

step:5
Write code - Terminal cmd
$gedit /opt/lampp/htdocs/FileName.php

New php editor open- Do your code here save and close

step:6
go browser ype:
http://localhost/FileName.php

Step:7
Rewrite the file
open file in terminal using
$ gedit /opt/lamp/htdocs/FileName.php


Note: My php root - www folder is located at computer->opt->lampp->htdocs

No comments:

Post a Comment