最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Image upload to media library fails. Folder won't create, database insert fail, XAMPP Windows

programmeradmin1浏览0评论

Environment: The WordPress site is on my local laptop, 4.9.6. Windows 10, XAMPP installation, PHP 7.

The procedure works fine on the remote production server with LAMP.

Problem: I'm trying to upload a new logo to the media library. The file seems to start to upload, but then I get the error message with the red vertical stripe on the left side,

revised logo.png

Could not insert post into the database

When I look in the uploads folder, the new month folder ("5" for May) hasn't been created, so the file wasn't uploaded, either.

Not sure where I need to start on this. The error message says database, but since the file was never uploaded, it seems like a file problem.

It Now Works:

I don't know why the WP Migrate tool exports SQL that doesn't set the ID columns of my WP tables to auto increment. In my case, setting wp_posts and wp_postmeta ID fields to auto increment, using PhpMyAdmin, was the last procedure I did that resulted in the media library being able to insert new images.

Environment: The WordPress site is on my local laptop, 4.9.6. Windows 10, XAMPP installation, PHP 7.

The procedure works fine on the remote production server with LAMP.

Problem: I'm trying to upload a new logo to the media library. The file seems to start to upload, but then I get the error message with the red vertical stripe on the left side,

revised logo.png

Could not insert post into the database

When I look in the uploads folder, the new month folder ("5" for May) hasn't been created, so the file wasn't uploaded, either.

Not sure where I need to start on this. The error message says database, but since the file was never uploaded, it seems like a file problem.

It Now Works:

I don't know why the WP Migrate tool exports SQL that doesn't set the ID columns of my WP tables to auto increment. In my case, setting wp_posts and wp_postmeta ID fields to auto increment, using PhpMyAdmin, was the last procedure I did that resulted in the media library being able to insert new images.

Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked May 20, 2018 at 15:46 Galloway GrumblefieldGalloway Grumblefield 351 silver badge8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

setting wp_posts ID field and wp_postmeta meta ID field to auto increment, using PhpMyAdmin. SOLVED MY PROBLEM

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论