I started learning PHP a week ago and I installed Eclipse for PHP. I have tried some basic codes since but today, when I runned a code to create a txt file (using fopen, fwrite, fclose), Eclipse said:

Unable to load page

Problem occurred while loading the URL http://localhost/test/newfile.php

Cannot connect to destination (localhost)

It is the same php file I used since the beginning so it is quite weird.

I am very new to Linux so I do not know what kind of information to provide so someone can help me. I checked other related questions and I could not understand all the information guys provided.

I use ubuntu 14.04.

Nevertheless, I tried to type wget in the terminal and the response was:

--2015-08-11 21:07:35--

Connecting to failed: Connection refused.

I am not sure what to do now.

Thanks for your answers!


It means that, on your system (localhost) there is no program listening to TCP port 80. You need to start a webserver, e.g., apache2 and configure it to handle your requests. Reread the beginning of your course, and see what it says about webserver requirements.

| improve this answer | |
  • Thanks for your comment ! The Linux section in the book I use (Learning PHP, MySQL & JavaScript, 4th Edition) being quite succinct, I looked for how to start my webserver elsewhere and I found the answer I needed here (askubuntu.com/questions/164652/…). – Dust009 Aug 11 '15 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.