WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#7570 closed defect (bug) (invalid)

Wrong upload directory on clean 2.6.1 installation

Reported by: gerritholl Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.6.1
Component: General Keywords:
Focuses: Cc:

Description

Hi,

On a fresh 2.6.1 install, images are uploaded to the wrong directory. My errorlog has, among other things, four 'PHP Warnings', one 'PHP Fatal Error' and one 'WordPress database error' (the full log is below)

I install wordpress according to the "Famous 5-Minute Install" (create a new, empty database, new user, etc).
I do not change any configuration other than entering my database information in the wp-config.php file.
I create a new post and upload an image. I select the HTTP uploader because my webhost (webreus.nl) does not allow the flash uploader (mod_security: Access denied with code 500. Pattern match "Shockwave Flash" at HEADER("USER-AGENT")).
I change the wp-content/-permissions to 777 because otherwise I will get the error "The uploaded file could not be moved to /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content".
The upload is succesful. In my logfile, it says:

213.93.165.246 - - [22/Aug/2008:12:34:03 +0200] "POST /wordpress/wp-admin/media-upload.php?post_id=3&type=image&flash=0 HTTP/1.1" 200 11056 "http://www.stratospheric-census.org/wordpress/wp-admin/media-upload.php?post_id=3&type=image&flash=0" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1"

The suggested "Link URL" is http://www.stratospheric-census.org/wordpress/wp-content/uploads/stratosphericcensus_group.jpg

When I click "Insert into post" it creates the following HTML code:

[caption id="attachment_6" align="alignnone" width="300" caption="the group"]<a href="http://www.stratospheric-census.org/wordpress/wp-content/uploads/stratosphericcensus_group2.jpg"><img class="size-medium wp-image-6" title="stratosphericcensus_group2" src="http://www.stratospheric-census.org/wordpress/wp-content/uploads/stratosphericcensus_group2-300x225.jpg" alt="the group" width="300" height="225" /></a>[/caption]

If I disable the linking by clicking "None" next to "Link URL" it creates the following HTML code (the caption-part is the same):

<img class="size-medium wp-image-5" title="stratosphericcensus_group1" src="http://www.stratospheric-census.org/wordpress/wp-content/uploads/stratosphericcensus_group1-300x225.jpg" alt="the group" width="300" height="225" />

The result in my httplog is like this:

213.93.165.246 - - [22/Aug/2008:12:35:36 +0200] "GET /wordpress/wp-content/uploads/stratosphericcensus_group-300x225.jpg HTTP/1.1" 404 1255 "http://www.stratospheric-census.org/wordpress/wp-admin/post-new.php" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1"

and in my errorlog is like this:

[Fri Aug 22 12:24:31 2008] [error] [client 213.93.165.246] PHP Warning:  require() [<a href='function.require'>function.require</a>]: Unable to access /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:31 2008] [error] [client 213.93.165.246] PHP Warning:  require(/var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:31 2008] [error] [client 213.93.165.246] PHP Warning:  require() [<a href='function.require'>function.require</a>]: Unable to access /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:31 2008] [error] [client 213.93.165.246] PHP Warning:  require(/var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:31 2008] [error] [client 213.93.165.246] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required '/var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php' (include_path='.:.:') in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:35 2008] [error] [client 213.93.165.246] PHP Warning:  require() [<a href='function.require'>function.require</a>]: Unable to access /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:35 2008] [error] [client 213.93.165.246] PHP Warning:  require(/var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:35 2008] [error] [client 213.93.165.246] PHP Warning:  require() [<a href='function.require'>function.require</a>]: Unable to access /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:35 2008] [error] [client 213.93.165.246] PHP Warning:  require(/var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:24:35 2008] [error] [client 213.93.165.246] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required '/var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-includes/compat.php' (include_path='.:.:') in /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-settings.php on line 207
[Fri Aug 22 12:26:45 2008] [error] [client 213.93.165.246] WordPress database error Table 'blog2.wp_options' doesn't exist for query INSERT INTO wp_options (option_name, option_value, autoload) VALUES ('cron', 'a:2:{i:1219400805;a:1:{s:17:\\"wp_update_plugins\\";a:1:{s:32:\\"40cd750bba9870f18aada2478b24840a\\";a:3:{s:8:\\"schedule\\";s:10:\\"twicedaily\\";s:4:\\"args\\";a:0:{}s:8:\\"interval\\";i:43200;}}}s:7:\\"version\\";i:2;}', 'yes') made by add_option
[Fri Aug 22 12:26:55 2008] [error] [client 213.93.165.246] WordPress database error Table 'blog2.wp_options' doesn't exist for query INSERT INTO wp_options (option_name, option_value, autoload) VALUES ('cron', 'a:2:{i:1219400815;a:1:{s:17:\\"wp_update_plugins\\";a:1:{s:32:\\"40cd750bba9870f18aada2478b24840a\\";a:3:{s:8:\\"schedule\\";s:10:\\"twicedaily\\";s:4:\\"args\\";a:0:{}s:8:\\"interval\\";i:43200;}}}s:7:\\"version\\";i:2;}', 'yes') made by add_option, referer: http://www.stratospheric-census.org/wordpress/wp-admin/install.php
[Fri Aug 22 12:34:05 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/media-upload.php?post_id=3&type=image&flash=0
[Fri Aug 22 12:35:37 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/post-new.php
[Fri Aug 22 12:35:43 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/post-new.php
[Fri Aug 22 12:37:48 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/media-upload.php?post_id=3&type=image&flash=0
[Fri Aug 22 12:38:03 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/post-new.php
[Fri Aug 22 12:38:09 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/?p=3&preview=true
[Fri Aug 22 12:38:43 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/post-new.php
[Fri Aug 22 12:39:11 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/post-new.php
[Fri Aug 22 12:40:09 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/media-upload.php?post_id=3&type=image&flash=0
[Fri Aug 22 12:40:19 2008] [error] [client 213.93.165.246] File does not exist: /var/www/vhosts/stratospheric-census.org/httpdocs/wordpress/wp-content/uploads, referer: http://www.stratospheric-census.org/wordpress/wp-admin/post-new.php

I am not sure what version of MySQL is running on my webhost (webreus.nl). Is there a page that gives some diagnostics that I can cut'n'paste here?

Change History (3)

comment:1 mrmist6 years ago

  • Version set to 2.6.1

Can't seem to reproduce this.

Does it happen the same for any size of image?

comment:2 gerritholl6 years ago

The image that I tested it for is:

/home/gerrit/downloads/StratosphericCensus_group.jpg JPEG 320x240 320x240+0+0 DirectClass 8-bit 141.75kb

The same error happens for another file that is:

/home/gerrit/documenten/studie/Master/Spacemaster/vakken/Cansat/region_Esrange_Google_Earth.jpg JPEG 1048x677 1048x677+0+0 DirectClass 8-bit 126.396kb

I suspect the size of the image does not make any difference.

I have found a workaround, albeit not a solution. The value for "Store uploads in this folder" was "wp-content/". I changed this to "wp-content/uploads", and now the error has disappeared. Note that I did not change this configuration before and I was working on a clean wordpress installation.

comment:3 jacobsantos6 years ago

  • Milestone 2.7 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Your WordPress installation appears to be incomplete. Most likely you didn't fully upload all files. WordPress will create folders in the uploads folder, but I don't think it will create the actual uploads folder if it doesn't exist.

Reopen if still not working in 2.7 and you have a complete upload of WordPress.

Note: See TracTickets for help on using tickets.