0

I've copied over my files over to a new directory which I have created: /var/www/worm/data.php. I tried opening it by a few ways:

  1. Double clicking the file but nothing comes out
  2. Typing localhost/worm/data.php into search browser, but nothing comes out either. Can someone please guide or tell me what can I do?

4 Answers 4

1

Please check the file permissions. You might not have the permission to read the file. You can use the chmod command to change permissions. You may also check the chown command. Once you have set the permissions correctly you should be able to open files using a text editor.

To open the file using localhost/worm/data.php, firstly make sure permissions are set properly to the files. The other thing to consider is to check if apache and php are installed or not. If they are not installed check the Apache Documentation.

0

You need a web server to view php files.

Install apache2 the default webserver.

sudo apt-get install apache2

then install php5

sudo apt-get install php5

then restart your apache2 server

sudo service apache2 restart

then just drop the php file(s) in the /var/www folder and go to

http://localhost/file.php

but replace file.php with the name of the file

More information here https://help.ubuntu.com/10.04/serverguide/httpd.html

0

Open Terminal using Ctrl+Alt+T, now type sudo -H gedit, then type your password and press enter. This will open the gEdit program with root permission. Now open your .php file where it's located or just drag the file into gEdit.

0

First let us identify what you mean to open php files:

Open for editing OR Open in web browser.

To open for editing just right click on the file and choose open with text Editor

To open in web browser you should have a web server. The most popular is apache. you can install it by the command:

sudo apt-get install apache2

Also you have to install php on your system

sudo apt-get install php5

Now to open the file copy it to the /var/www directory and then navigate in your browser to localhost/file.php

1
  • I've already apache2 and php5 installed and the server is running, but whenever i open it on browser, it's just a blank screen. Apr 21, 2014 at 1:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .