Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Firstly I followed the instructions on the following site to install the LAMP server:

http://www.multimediaboom.com/how-to-install-lamp-server-in-ubuntu-11-0410-1010-04/#comment-48391

step 3: go to http://localhost/phpmyadmin This did not work. It came up with a 404 error at first then after running "sudo ln -s /usr/share/phpmyadmin /var/www" it came up with a 403 error and said "Forbidden: You don't have permission to access /phpmyadmin on this server".

Then the last step was to make a simple php file and test that php was working. I could not save the file into /var/www/

So to recap:

  1. How do I get around the 403 forbidden error for phpmyadmin?
  2. How do I save / copy / make files in /var/www/ when it is owned by root?

EDIT:

I have managed to save the test.php file into /var/www/ by launching gedit via the gksudo command. When I go to localhost/test.php however it downloads the test.php file instead of running it on the server.


Apache2 error log file contents:

[Tue Oct 04 15:30:27 2011] [notice] Apache/2.2.17 (Ubuntu) configured -- resuming normal operations
[Tue Oct 04 15:30:30 2011] [notice] Graceful restart requested, doing restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Tue Oct 04 15:30:30 2011] [notice] Apache/2.2.17 (Ubuntu) configured -- resuming normal operations
[Tue Oct 04 15:31:46 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 15:32:27 2011] [error] [client 127.0.0.1] File does not exist: /var/www/phpmyadmin
[Tue Oct 04 15:32:27 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 15:33:17 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 15:33:17 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:23 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:23 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:25 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:25 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:31 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:31 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:32 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:32 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 16:55:33 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 16:55:52 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:06:15 2011] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin
[Tue Oct 04 17:06:15 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[    Tue Oct 04 17:24:34 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:24:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/php
[Tue Oct 04 17:24:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:25:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 17:25:42 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 18:31:45 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico
[Tue Oct 04 19:07:40 2011] [error] [client 127.0.0.1] File does not exist: /var/www/favicon.ico

Thanks.

share|improve this question

2 Answers 2

Try editing apache2.conf or httpd.conf

sudo nano /etc/apache2/apache2.conf

Make sure you have there

include /etc/phpmyadmin/apache.conf
alias /phpmyadmin /usr/share/phpmyadmin

And that they are uncommented. I am not sure about the paths. 1st one will include phpmyadmin config file. 2nd will make phpmyadmin available on 127.0.0.1/phpmyadmin. I'd have to see those config files. Try different things restarting apache on each change:

sudo service apache2 restart
share|improve this answer

The directories need to be "executables" try a chmod 0755 /var/www

For php, you may need to do this :

sudo a2enmod php5
sudo service apache2 restart

To answer your 2 questions

  1. Checkout the /var/log/httpd/error.log
  2. You write them with sudo or make a subdirectory with the appropriates permissions for your user

Worth reading :

ref: https://help.ubuntu.com/community/ApacheMySQLPHP#Installing_PHP_5

share|improve this answer
    
chmod 0755 done no change. -- php said it was already enabled. -- apache restart failed. It could not find the apache.conf file. -- 1. there was no httpd folder -- 2. figured out how to write to the directory thanks. –  cohen Oct 4 '11 at 7:36
    
Sorry it is /var/log/apache2/, look for the error log to know why you receive theses errors. If you are still unsure, paste them here. –  jflaflamme Oct 4 '11 at 7:42
    
Thanks, I'm new to php as well as linux so I posted the error file contents above. –  cohen Oct 4 '11 at 10:37
    
I read the link you posted above. it said "If this doesn't work, then it is a problem of file authorisation". Not quite sure what that means. I dont know if I did the chmod correctly though. Do you think I could have step by step instructions for the chmod? Cheers. –  cohen Oct 4 '11 at 11:07
    
"chmod: changing permissions of `/var/www': Operation not permitted" How do I change the permissions for this directory? I put a sudo in front of it but I dont think that works (as nothing happened). –  cohen Oct 4 '11 at 11:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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