Ubuntu Forums Archive Viewer

I need help to set up php

Archived thread 1002786 from Programming Talk. Markdown source: Programming_Talk/thread_1002786_I_need_help_to_set_up_php.md

Original URL About this archive
#1

I have used lots of time to make php work on ubuntu without a success. I used NetBeans I have follow this link http://www.netbeans.org/kb/docs/php/configure-php-environment-ubuntu.html then create a little project when I run my browser point to

http://localhost/PhpProject1/index.php I always get the error 404 Not Found

thanks

#2

I had a similar problem once before. I do not know if what I did to resolve the issue was correct or not, but this is what I did:

  1. sudo vi /etc/apache2/sites-available/default
  1. Change the following:

     #DocumentRoot /var/www
     DocumentRoot /home/user
  1. Change the following:

     #<Directory /var/www>
     <Directory /home/user>
  1. Save the file.

Replace the "user" above with your userid.

That should do it. Try running your script again via the browser.

#3

when I run sudo /etc/init.d/apache2 restart

I get the following error

test@ubuntu:~$ gksudo gedit /etc/apache2/sites-available/mysite test@ubuntu:~$ sudo /etc/init.d/apache2 restart * Restarting web server apache2 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs

#4

hoboy said: test@ubuntu:~$ sudo /etc/init.d/apache2 restart

* Restarting web server apache2 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs

It looks like another server is already trying to bind to port 80, so Apache can't. Try the 'netstat -l' command to find out what.

I don't know what the last line ("Unable to open logs") means.

#5

I have installed xampp now the problem is how to set ubuntu to deploy php projects under it.now when I create php project in netbeans then run it inside the ide I get the following error The requested URL /NetBeansProjects/index.php was not found on this server.

#6

problem is solved

#7

hoboy said: problem is solved

Thanks for sharing your solution!