Skip to content Skip to sidebar Skip to footer

Running A Html And Php On Ubuntu

I am new to HTML and PHP. All I want to do is that I made a HTML file and a PHP file and now I want to test it on my local server i.e. my own computer. My HTML file includes the f

Solution 1:

if you installed apache then go to /var/www directory. create a folder there . then paste your code files there . then open a terminel .. and change the permission of folder. for your local project i suggest to give full permission as you are starter .. command is

chmod 777 -R /var/www/your_folder_name  // use sudo in start if user not root

then open up a browser then go for link ...

localhost/your_folder_name/Test001.php

your must see output for your php file

Solution 2:

First you have to install some software, there is a software named "LAMP".

Here you can see the official ubuntu tutorial -> Tutorial click here

What is LAMP? LAMP is a box that contain some little software :

 - Server (apache2) : Entity that discuss with your browser
 - PHP5             : Install the langage
 - MySql            : Install the langage Mysql used to interact with BDD

Second you have to go into your brower and type "localhost" into http:// input.

Third if you want to access to your html file, put it into /var/www directory (in your computer) and access it using http:// input.

Example :

 - Name of the file is'*toto.html*'
 - Type '*localhost/toto.html*'into *http://* input

If you have any questions about that, you are welcome buddy :)

Post a Comment for "Running A Html And Php On Ubuntu"