Server Error

December 2, 2013 10.8k views
Hi, I installed wordpress in Ubuntu server with the help of the article provided here. It was successful and I could access new wordpress site through my provided ip address (http://162.243.247.71/). My main motive was to transfer my existing wordpress site to DO. After succesful installation of wordpress site, I transferred wp-content and sql file as illustrated in the article: https://www.digitalocean.com/community/articles/how-to-migrate-wordpress-from-shared-hosting-to-a-cloud-server-with-zero-downtime I could see the old tables(with different prefix) to the database I created while installing wp site in phpmyadmin. I deleted the default tables with wp_ prefix and changed the prefix setting in wp-config.php coz my database is now using different prefix. But now I cannot access the site. It says: Server Error. Where did I do wrong? Any suggestions.... Thanks in advanced.
1 comment
13 Answers
There's your problem. Run these commands:
sudo chown -R www-data. /var/www

find /var/www -type d -exec chmod 755 {} \;
find /var/www -type f -exec chmod 644 {} \;
Check Apache's error logs, do you see anything?

tail /var/log/apache2/error.log
Hi,
The following errors are displayed:

PHP Warning: require_once(/var/www/wp-content/db.php): failed to open stream: Permission denied in /var/www/wp-includes/load.php on line 329
PHP Fatal error: require_once(): Failed opening required '/var/www/wp-content/db.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/wp-includes/load.php on line 329
File does not exist: /var/www/favicon.ico

"... with the help of the article provided here."

Which one? There are over 7 Ubuntu-WordPress articles.

You might be encountering a permissions problem. What's the output of
ls -la /path/to/WordPress/Installation/
@pablo:
This one: https://www.digitalocean.com/community/articles/how-to-install-wordpress-on-ubuntu-12-04

Is it /var/www for /path/to........ ? Sorry but I'm completely New to this. :)

-rw-r--r-- for files
drwxr-xr-x for dirs
by Etel Sverdlov
Wordpress is a free and open source website and blogging tool that uses php and MySQL. It was created in 2003 and has since then expanded to manage 22% of all the new websites created and has over 20,000 plugins to customize its functionality. This tutorial shows how to install Wordpress on a server with LAMP. It is written for Ubuntu 12.04.
Do you see root:root anywhere in there? It needs to be all www-data:www-data.
@Pablo:
Here is the full info:
drwxr-xr-x 5 tushar tushar 4096 Dec 2 09:30 .
drwxr-xr-x 12 root root 4096 Dec 2 08:34 ..
-rw-r--r-- 1 root root 45 Dec 2 09:10 .htpasswd
-rw-r--r-- 1 www-data www-data 177 Dec 2 08:34 index.html
-rw-r--r-- 1 www-data www-data 418 Sep 25 00:18 index.php
-rw-r--r-- 1 www-data www-data 19929 Jan 18 2013 license.txt
-rw-r--r-- 1 www-data www-data 7128 Oct 23 20:08 readme.html
-rw-r--r-- 1 www-data www-data 4892 Oct 4 14:12 wp-activate.php
drwxr-xr-x 9 www-data www-data 4096 Oct 29 20:08 wp-admin
-rw-r--r-- 1 www-data www-data 271 Jan 8 2012 wp-blog-header.php
-rw-r--r-- 1 www-data www-data 4795 Sep 6 01:38 wp-comments-post.php
-rw-r--r-- 1 www-data www-data 3172 Dec 2 15:37 wp-config.php
-rw-r--r-- 1 www-data www-data 3177 Nov 1 2010 wp-config-sample.php
drwxr-xr-x 10 www-data www-data 4096 Dec 2 15:08 wp-content
-rw-r--r-- 1 www-data www-data 2932 Sep 25 00:18 wp-cron.php
drwxr-xr-x 11 www-data www-data 4096 Oct 29 20:08 wp-includes
-rw-r--r-- 1 www-data www-data 2380 Sep 25 00:18 wp-links-opml.php
-rw-r--r-- 1 www-data www-data 2359 Sep 12 06:57 wp-load.php
-rw-r--r-- 1 www-data www-data 31739 Oct 23 14:40 wp-login.php
-rw-r--r-- 1 www-data www-data 7772 Oct 22 17:22 wp-mail.php
-rw-r--r-- 1 www-data www-data 10585 Oct 7 19:34 wp-settings.php
-rw-r--r-- 1 www-data www-data 25673 Oct 22 17:22 wp-signup.php
-rw-r--r-- 1 www-data www-data 4026 Sep 25 00:18 wp-trackback.php
-rw-r--r-- 1 www-data www-data 3015 Oct 23 14:40 xmlrpc.php
What's the output of
ls -lah /var/www/wp-content
?
@kamal:
It's:
drwxr-xr-x 10 www-data www-data 4.0K Dec 2 15:08 .
drwxr-xr-x 5 tushar tushar 4.0K Dec 2 09:30 ..
-rw------- 1 root root 1.2K Dec 2 13:12 advanced-cache.php
drwx------ 2 root root 4.0K Dec 2 13:58 backup-db
drwx------ 8 root root 4.0K Dec 2 13:58 cache
-rw------- 1 root root 1.5K Dec 2 13:33 db.php
-rw------- 1 root root 28 Jan 8 2012 index.php
-rw------- 1 root root 4.9K Dec 2 13:33 object-cache.php
drwx------ 6 root root 4.0K Dec 2 13:58 pageflip
drwxr-xr-x 8 www-data www-data 4.0K Dec 2 15:08 plugins
drwxr-xr-x 5 www-data www-data 4.0K Dec 2 15:08 themes
drwx------ 2 root root 4.0K Dec 2 13:15 upgrade
drwx------ 4 root root 4.0K Dec 2 15:32 uploads
drwx------ 2 root root 4.0K Dec 2 13:58 w3tc-config
Thank you for the support.
It really helped.
Hi,
The site could be accessed and the HOME Page is displaying but none of the other links are working. It is showing 404 Not Found.
What might be the problem?
Check apache's error logs again and see which files it can't find.
Hi Kamal,
Thanks for the great support.
I pointed my domain to DO and it is working fine.
http://livingwithict.com
Have another answer? Share your knowledge.