1

I have this problem getting my newly created php project on Netbeans work on Ubuntu. I've tried to place the source folder of the project in the /lampp/htdocs folder or selected the copy location option on the 3rd step of creating the project, yet none of them worked.

Here the version of the softwares I'm using:

  • Netbeans 7.1
  • LAMPP (newly download)
  • Ubuntu 11.10 (up-to-date)

I would be thankful if steps can be provided.

David B
  • 3,269
  • 12
  • 48
  • 80
  • 1
    By work do you mean that you are unable to open the project on Netbeans? or you can't open the project in the browser? – Songo Mar 22 '12 at 14:18
  • why do you use lampp/xampp instead of ubuntu packages? `apt-get install apache2 libapache2-mod-php5 php5 mysql-server-5.1 mysql-client-5.1 phpmyadmin` – Carlos Campderrós Mar 22 '12 at 14:20
  • @Songo I'm unable to run a newly created project using either of those steps. – David B Mar 22 '12 at 22:37
  • @CarlosCampderrós having to install those ubuntu packages would make a differenes if ever I'm going to transfer OS back to Windows? – David B Mar 22 '12 at 22:38
  • @Dr. Java hmmm so you opened Netbeans. clicked open project. navigated to /lampp/htdocs but can't find your project? Have you tried creating a new project with existing source? – Songo Mar 22 '12 at 23:22
  • @Songo I'm not trying to open an existing, I'm trying to create a new project and run it on LAMPP. – David B Mar 23 '12 at 08:57
  • @Dr.Java it shouldn't make any difference, as long as you have all php extensions in the two systems. Probably with xampp you'll have it easier because both builds will have the same configuration. – Carlos Campderrós Mar 23 '12 at 10:33

1 Answers1

5

Ok I'll give you everything I usually do From the moment I download a new version of Ubuntu.

  1. After installing Ubuntu I download XAMPP for Linux and follow their installation guide. Pay extra care to the permission when extracting XAMPP. Be sure you extracted it in the correct folder /opt.

  2. You must start XAMPP manually by using the command /opt/lampp/lampp start. You will need root access for that. If everthing was started normally you will get the following message in the terminal:

    Starting XAMPP 1.7.7... LAMPP: Starting Apache... LAMPP: Starting MySQL... LAMPP started.

  3. Navigate to http://localhost or http://127.0.0.1 you should see the following screen. XAMPP startup screen
    (source: techblissonline.com)

  4. Select your favorite language then voila your installation is complete.

  5. create a new Netbeans project and call it test for example inside /opt/lampp/htdocs/.

  6. Create an index.php file inside /opt/lampp/htdocs/test/ and put echo phpinfo() inside it.

  7. Navigate to http://localhost/test/index.php and you should get the page you just wrote.

Notes:

  • Make sure all php extensions that you need are already installed by checking the phpinfo() page in XAMPP.

  • You would probably want to start XAMPP each time you start your PC instead of doing it manually every time. There are several ways to do that if you google it.

    Have you tried all these steps and still can't get your project running ?

Community
  • 1
  • 1
Songo
  • 5,618
  • 8
  • 58
  • 96
  • I have this error in step 5, `Sources folder is not writable`. How can I make Netbeans have root access to that folder, `/opt/lampp/htdocs`? – David B Mar 23 '12 at 12:37
  • 1
    This is probably a permission problem that wouldn't have happened if you extracted the XAMPP package correctly with the right permissions. Don't worry it happens to all of us (^^,). Just change the folder's permission to 777 (although not recommended). Use the following command: `sudo chmod 777 -R /opt/lampp/htdocs`. This will give you (and everyone) full permission on `/opt/lampp/htdocs` and anything inside it. – Songo Mar 23 '12 at 12:44
  • You don't need to echo `phpinfo()` :P – I wrestled a bear once. Aug 21 '14 at 15:53