Wordpress "setup-mysql" script broken

Bug #1009719 reported by Kyle Gorman on 2012-06-06
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
wordpress (Ubuntu)
Undecided
Unassigned

Bug Description

The wordpress (3.3.1+dfsg-1) package in Ubuntu 12.04 LTS installs a script called /usr/share/doc/wordpress/examples/setup-mysql. Since setting up the wordpress mysql database isn't trivial, lots of tutorial recommend using it (e.g., http://ubuntuserverguide.com/2012/05/how-to-install-latest-wordpress-in-ubuntu-server-12-04-lts.html). I assume the user is using wordpress with a standard LAMP stack (e.g., the one installed by tasksel, which includes apache and mysql). Most tutorials write that you only need to do two things after installing theese packages: you need to link /usr/share/wordpress to a directory that Apache sees (I did 'sudo ln -s /usr/share/wordpress /var/www/wordpress'), and you need to run this setup-mysql script (which appears to ultimately come from Debian, not wordpress itself).

However, that produced a broken installation on my system, when I issued 'sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost'. I expected this to produce a working install when I went to localhost/wordpress in a browser, but uploading was broken in two ways. First, it created a directory /srv/www/wp-uploads/$DOMAIN (don't ask me why it creates a new root-level directory: shouldn't this be in /var?), but assigned the wrong permissions to this directory. Consequently, uploads fail, producing a php error that you can see in the browser. Secondly, it creates a wordpress config file /etc/wordpress/config-$DOMAIN.php that pointed to a different directory than the above-mentioned /srv/www/wp-uploads/$DOMAIN, so that no uploaded image links work. Inspection of /var/log/apache2/error.log showed that it was looking for these files in the wrong place. I solved this by putting wp-uploads with the rest of the wordpress stuff (/var/www/wordpress/) and telling the /etc/wordpress/config-$DOMAIN.php what I had done.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in wordpress (Ubuntu):
status: New → Confirmed
Diogo Kollross (diogoko) wrote :

Confirming that this bug still affects version 3.8.2+dfsg-1 of wordpress package. The install procedure described above, suggesting the use of the setup-mysql, is also present at https://help.ubuntu.com/community/WordPress.

In my case, I fixed the problem by changing WP_CONTENT_DIR from /srv/www/wp-content/localhost to /var/lib/wordpress/wp-content in /etc/wordpress/config-localhost.php.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers