Web Hosting Forum | Lunarpages

Author Topic: 403 Forbidden error when attempting to import posts using Wordpress importer  (Read 7775 times)

Offline dawid84

  • Newbie
  • *
  • Posts: 4
Hello, I'm having a similar issue to the one described in this thread:

http://www.lunarforums.com/third-party-scripts-and-services/(solved)-strange-403-or-404-forbidden-errors-with-wordpress/

But only when I attempt to upload a certain xml file (exported from a wordpress.com site) using the wordpress importer plugin. The importer appears to work fine when I attempt to upload a different xml file through the importer.

The error message is “You don't have permission to access /wp-admin/admin.php on this server.”

I tried applying the fix suggested in the thread above but it did not work for me. All permissions appear to be set correctly, and nothing else is out of the ordinary in my .htaccess file. Also, I'm able to upload the file on my local dev environment.

I did, prior to installing wordpress, change the PHP version in LunarPanel to 5.5 as my theme requires a minimum 5.4 version so maybe this has something to do with it.

Any help would be much appreciated.

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6197
(I just updated the other thread you referred to)

So, you are able to use /wp-admin/admin.php (directly or indirectly) to import other XML files, but this particular one gives an error? That would imply that the WP files and directories have the correct permissions. I'm not a WP maven, but my guess would be that one of two things is going on:
  • The XML file has odd permissions... check its permissions against other ones you've successfully imported.
  • The XML file has certain keywords or constructs in it that fool the server's security into thinking it's something malicious. Sometimes it can be as simple as a GET or POST word. If you have an up to date WP installation, and feel that it has adequate security built in, you could try disabling the server's security checks as described in the referenced post. If you already tried that, I'm out of ideas.
Is this something that uploads from your PC, or does it import an already-uploaded file? If from a PC, is it a large or small file (compared to ones which have been successfully imported)? PHP has various size limits built in for uploads and POSTs, and you might have to change them if this file is larger than others. Also confirm that this file doesn't have odd permissions on the PC (Windows?) that would prevent it from being read.
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

Offline dawid84

  • Newbie
  • *
  • Posts: 4
Thank you for the quick reply.

Permissions on the file in question (it's actually a set of 3 files broken into chunks of 3mb each, as the wordpress.com exporter generated by default.), are normal (same as the one I am able to upload.)

Your second guess is what I feel is going on but changing the server's security checks as described in that post did not solve the problem.

I did get a response from support today that suggested it could be the file upload limit (which apparently was set to 2mb previously), and after making the changes to the php.ini and .htaccess files I see the upload limit in the wordpress importer plugin says 100mb. Still, I am getting the error though.

The xml file is something that uploads from my PC. I don't see a way in WP admin to import an already uploaded file but when I try to upload the file manually through the media uploader I get a generic HTTP error message inside wordpress.

Offline dawid84

  • Newbie
  • *
  • Posts: 4
Also: it appears this forum is replacing the name of the actual website I wrote (wordpressdotcom) to lunarpages.com

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6197
If it's uploading the file from the PC, it will be subject to PHP's upload limit, regardless of WP's own limit. (There may be more than one setting; it's been a while since I thought about this, but there should be some discussion if you search for it.) Be sure to run the script
Code: [Select]
<?php phpinfo(); ?>before and after making a change to php.ini, to confirm that your change "took".

As for WP being changed to lunarpages.com, I would assume that someone was spamming using that domain and it was "censored" because of that. I'll ask the other moderators what's up.
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

Offline dawid84

  • Newbie
  • *
  • Posts: 4
I've resolved the issue. It appears my attempts to disable mod_security myself didn't "take" as you suggested. Had to have support do it.

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6197
Regarding the forum "censoring" of wordpress . com to lunarpages.com, that is proper behavior (desired by Lunarpages). WP.com is a rival host (specifically for WP blogs), and we don't want to give the impression of endorsing them.

Your source of WordPress software is actually wordpress.org, which is not censored.

word press => wordpress
wordpress . com => lunarpages.com
wordpress . org => wordpress.org
« Last Edit: November 02, 2015, 07:27:32 AM by MrPhil »
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

 

Share |