Cannot upload themes on WordPress using Xampp

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Cannot upload themes on WordPress using Xampp

Postby ginoongflores » 08. June 2022 08:53

I have this error when uploading an installed theme in WordPress using Xampp. It says
Code: Select all
Unpacking the package... Could not create a directory


I have a fresh installation of WordPress in Linux mint, and I notice I don't have an upgrade, and uploads on my wp-content folder, only plugins, and theme. So, I copied the uploads folder from my windows machine, which installed a WordPress windows version with no conflicts. Because when I didn't have the uploads folder, it gave me an error saying
Code: Select all
Unable to create directory wp-content/uploads/2022/06. Is its parent directory writable by the server?
. So, I added the uploads folder manually, but I don't think it's appropriate.

Although I can upload the theme by unzipping the folder and pasting it manually into the themes folder, it doesn't give me peace of mind knowing that there are things that don't work in my Xampp directory.

Things I've tried
- Added necessary permission in all directories and files
- Added define( 'UPLOADS', 'wp-content/uploads' ); to my wp-config.php file
- define('FS_METHOD','direct'); I also added this line of code, so I can test a website without using FTP

My WordPress permission.
Image

I spend 3days figuring this out. I come from Zorin OS Lite XFCE first and now Linux Mint, but still, this error persists. I hope someone can lend me some help. Thanks!
ginoongflores
 
Posts: 4
Joined: 08. June 2022 08:22
XAMPP version: 8.1.6-0
Operating System: Linux Mint

Re: Cannot upload themes on WordPress using Xampp

Postby Nobbie » 08. June 2022 10:37

You have to apply chmod 0777 to /opt/lampp/htdocs and all subfolders.

You can do this recursively by this command:

Code: Select all
sudo find /opt/lampp/htdocs -type d -exec chmod 0777 {} \;


Copy paste this command into a shell including the backslash and semicolon at the end.
Nobbie
 
Posts: 13177
Joined: 09. March 2008 13:04

Re: Cannot upload themes on WordPress using Xampp

Postby ginoongflores » 09. June 2022 04:19

Hello, I tried it out and it works well. I can now upload a theme. A follow-up question, I have some issues in the site health panel of WordPress it says

Code: Select all
Error Some files are not writable by WordPress:
xmlrpc.php
wp-blog-header.php
readme.html
wp-signup.php
index.php
wp-cron.php
wp-login.php
wp-settings.php
license.txt
wp-mail.php
wp-links-opml.php
wp-load.php
wp-includes/class-wp-user-query.php
wp-includes/l10n.php
wp-includes/date.php
wp-includes/php-compat/readonly.php
wp-includes/class-wp-oembed.php
wp-includes/images/w-logo-blue-white-bg.png
wp-includes/images/blank.gif
wp-includes/images/down_arrow.gif


Although I didn't encounter a problem doing stuff in WordPress right now. But, do I also need to change all these files' permission using chmod 755?
ginoongflores
 
Posts: 4
Joined: 08. June 2022 08:22
XAMPP version: 8.1.6-0
Operating System: Linux Mint

Re: Cannot upload themes on WordPress using Xampp

Postby Nobbie » 09. June 2022 09:58

For files (not directories) you should change to 666 (not 755).

Actually, i can only help for linux questions, not for WordPress. For any WordPress specific problems you should ask in a WordPress forum.
Nobbie
 
Posts: 13177
Joined: 09. March 2008 13:04

Re: Cannot upload themes on WordPress using Xampp

Postby ginoongflores » 09. June 2022 15:00

Alright, I understand. Btw, thanks for responding.
ginoongflores
 
Posts: 4
Joined: 08. June 2022 08:22
XAMPP version: 8.1.6-0
Operating System: Linux Mint

Re: Cannot upload themes on WordPress using Xampp

Postby ginoongflores » 09. June 2022 15:26

Code: Select all
sudo find /opt/lampp/htdocs -type d -exec chmod 0777 {} \;


Update, someone says that this command is not good as this can cause vulnerabilities in my web server. Although, it works in uploading a theme. But, do you have any other command that would not compromise the security?
ginoongflores
 
Posts: 4
Joined: 08. June 2022 08:22
XAMPP version: 8.1.6-0
Operating System: Linux Mint


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 52 guests