PCLZIP_ERR_MISSING_FILE (-4) and Wordpress errors in CentOS (DirectAdmin)

jackbauer

Verified User
Joined
Dec 28, 2020
Messages
21
Before you tell me to create a tmp folder and use define('WP_TEMP_DIR', ABSPATH . 'wp-content/temp'); inside wordpress configuration file, this is more complicated than it looks. I'm using CentOS 8, with Directadmin, and recently I've moved to another server. After moving, I started getting this error which seemed like just a permissions problem in the tmp folder, I even followed a tutorial telling to set the tmp folder path in openbase_dir funcion inside php.ini, in order to enable openbase_dir for that folder. Despite what I did, enabling openbase_dir, disabling, enabling it from the control panel in Directadmin, disabling it from the control panel, creating a custom temp folder inside wp-content folder and defining the code inside the configuration file, everything I tried failed. Also, I have like 85% of free diskspace, so I don't believe that's a disk problem. I even fixed all permissions in all folders.

The best thing I could achieve, with the help of my hosting company (and that's an unmanaged hosting) was getting rid of the "PCLZIP_ERR_MISSING_FILE (-4)" when installing or updating a plugin, but pretty much everything else that relies on the tmp folder is just not working. I can't upload images in my posts because it will say "Missing a temporary folder", I can't save a layout in my Gantry5 theme because it will return the error "400 Bad Request Oops, Error while saving layout: Structure missing.". Whichever fix I tried so far just didn't work, but it doesn't mean that I'm not able to get this thing working, I am able: temporarily.

If I restart the server, everything will work just fine, without the need to touch anything, there'll be no tmp folder problem. The thing is, after 1 hour or so, the problem will go back.
 
The best thing I could achieve, with the help of my hosting company
So you're not admin and no reseller if I'm correct? Do you have admin and root access to the server?
The thing is, after 1 hour or so, the problem will go back.
Looks like something is getting filled in that time.

Also, I have like 85% of free diskspace, so I don't believe that's a disk problem.
That might be the case, but be aware that there is a big difference in free diskspace and free space on the user account. If you're using quota on the user account.
Also if the /tmp folder is mounted separately, it could be the /tmp mount is filling up.

Might be interesting to do the df -h command to see all mounts and available space right after a reboot.
Do the same about half an hour later and maybe this shows if and where it's filling up.

I would suggest to use the default temp folder of directadmin because with defaults it's the best way to track down issues.
I'm not directly saying that I can, maybe somebody else here, but it's more difficult to check custom made things than default things.

Also in older post, I read that the "Error while saving layout: Structure missing" could be caused by mod_security. If you have that enabled, I would suggest to disable that and try again, see of the error persists.
 
So you're not admin and no reseller if I'm correct? Do you have admin and root access to the server?

Looks like something is getting filled in that time.


That might be the case, but be aware that there is a big difference in free diskspace and free space on the user account. If you're using quota on the user account.
Also if the /tmp folder is mounted separately, it could be the /tmp mount is filling up.

Might be interesting to do the df -h command to see all mounts and available space right after a reboot.
Do the same about half an hour later and maybe this shows if and where it's filling up.

I would suggest to use the default temp folder of directadmin because with defaults it's the best way to track down issues.
I'm not directly saying that I can, maybe somebody else here, but it's more difficult to check custom made things than default things.

Also in older post, I read that the "Error while saving layout: Structure missing" could be caused by mod_security. If you have that enabled, I would suggest to disable that and try again, see of the error persists.
Hey, thanks for reaching up. I finally made it. Had to set 755 permissions on the tmp folder from the command line, now I not even need to use that Wordpress workaround with custom folder anymore. Looks like the hosting company changed the tmp folder permissions to 700 when they moved my files to another server. Geez...

The command line I used was:

chmod 755 tmp

This post can be marked as solved.
 
Hold on, let me post their last reply first:

"Hello,

Its a Virtuozzo container not a dedicated server. There is only one mount, ie on / . I don't see anything filling up, there is enough space:

----
Filesystem Size Used Avail Use% Mounted on
/dev/ploop13917p1 35G 7.0G 26G 22% /
----

Mod security is not enabled.

I have done:
chmod 755 /home/USER/tmp

Does it work now?"
 
their last reply first:
So you don't have direct access to the server, but others need to do things for you?

They should have done:
chmod 1777 /tmp

As far as I know there shouldn't even be a /home/USER/tmp present except when something is customized, which makes searching for a cause a lot harder.
 
So you don't have direct access to the server, but others need to do things for you?

They should have done:
chmod 1777 /tmp

As far as I know there shouldn't even be a /home/USER/tmp present except when something is customized, which makes searching for a cause a lot harder.
Is there any command I can use to make the server use the /tmp folder instead of /home/USER/tmp?

This was my last chat with the support:

You April 23, 2022 6:57 PM
hi
Agent April 23, 2022 7:01 PM
Welcome to live chat support! How may I assist you today?
You April 23, 2022 7:01 PM
Ticket yyyyyyyyyyyyyyyyyyy
Agent April 23, 2022 7:09 PM
We can try issuing a new KVM VPS
Agent April 23, 2022 7:10 PM
you can reproduce the problem there
Agent April 23, 2022 7:10 PM
unfortunately, migration is not supported for VPS less than 4 slices
You April 23, 2022 7:11 PM
why don't you just solve the VPS problem as things are now?
Agent April 23, 2022 7:11 PM
it's a 1 slice unmanaged VPS
You April 23, 2022 7:13 PM
And I've already tried everything that was suggested by "Hosting Company Name" and that I found online, nothing really solved, so is it something that I could solve?
Agent April 23, 2022 7:15 PM
Unfortunately we are out of options, we can try providing you KVM VPS
You April 23, 2022 7:16 PM
I'm satisfied with direct admin. I just need things to work as they should.
You April 23, 2022 7:17 PM
I'm satisfied with direct admin. I just need this thing to work as it should.
Agent April 23, 2022 7:18 PM
you are on a directadmin plan without support for license, so DA cannot help on this issue
You April 23, 2022 7:18 PM
Is this something that I can solve by myself?
Agent April 23, 2022 7:18 PM
does not look like it
You April 23, 2022 7:20 PM
then "Hosting Company Name" gives me something that does not work, that I can't fix and tell me that "Hosting Company Name" is not going to fix it. Moving to another server is not a fix. This thing was already moved because the previous server was also with issues.
Agent April 23, 2022 7:21 PM
unfortunately, we are out of options
You April 23, 2022 7:21 PM
Can you reinstall the VPS without destroying my website's data?
Agent April 23, 2022 7:21 PM
that's not possible
You April 23, 2022 7:22 PM
why?
Agent April 23, 2022 7:22 PM
it will remove all content from the VPS
You April 23, 2022 7:23 PM
wait a minute.


====Richard G, at that moment I ended the chat because I saw your answer. ====
 
I've used:
php_home_tmp_session_save_path=0

Then:
chmod 1777 /home/USER/tmp
and:
chmod 1777 /tmp

and then:
cd /usr/local/directadmin/custombuild ./build update ./build mod_htscanner2

It worked, but then I switched php_home_tmp_session_save_path=0 back to php_home_tmp_session_save_path=1 and rebuilt things again.

I've been trying to fix this issue for almost... 24 hours. It's working right now, but I still need to run some tests.

Question: is it fine if I leave the /home/USER/tmp to be used as the tmp folder? Isn't it going to have a security flaw if I leave as /home/tmp or /tmp?

By the way: what is mod_htscanner2 for? lol
Do I really need it?
 
Last edited:
idk how to find your issued or best way to fix. but if you want to try. you can make change inside your php-app before do other thing, just test it on your App first.

/tmp folder
already is in open_basedir

just make your app to use /tmp
 
Question: is it fine if I leave the /home/USER/tmp to be used as the tmp folder? Isn't it going to have a security flaw if I leave as /home/tmp or /tmp?
The /home/tmp and /tmp folders are the default. Probably won't be an issue if you keep /home/USER/tmp with the chmod 1777. Not 100% sure. I never use these kinds of things customly.
The mod_htscanner2 is so you can keep using all entry's in the .htaccess file when using php-fpm.
 
The problem is back, I'll use php_home_tmp_session_save_path=0 now and see what happens. Is there a way to use /tmp instead of /home/tmp?

Update: just settled php_home_tmp_session_save_path=0, tried to rebuild and guess what happened?
-bash: ./build: No such file or directory

It was there before, it was installed. Looks like it was reset by some configuration.
 
Last edited:
Normally the build script does not dissapear. It's in the custombuild directory.

If it's really gone, you can always get a new one.
Code:
cd /usr/local/directadmin/custombuild
wget https://files1.directadmin.com/services/custombuild/2.0/custombuild/build
then run ./build update first just to be sure.
 
Just thinking out loud, could this 'tmp' problem possibly be that Bubblewrap/jailshell is enabled/installed and has some compatibility problem with the Virtuozzo container virtualization? I'm just assuming here it is installed. As that may require the container nesting feature enabled. This is just a guess, seems quite the unusual problem.
 
Normally the build script does not dissapear. It's in the custombuild directory.

If it's really gone, you can always get a new one.
Code:
cd /usr/local/directadmin/custombuild
wget https://files1.directadmin.com/services/custombuild/2.0/custombuild/build
then run ./build update first just to be sure.
Ran first:
# ./build update
-bash: ./build: No such file or directory

Just thinking out loud, could this 'tmp' problem possibly be that Bubblewrap/jailshell is enabled/installed and has some compatibility problem with the Virtuozzo container virtualization? I'm just assuming here it is installed. As that may require the container nesting feature enabled. This is just a guess, seems quite the unusual problem.
To be honest I was expecting to receive a working VPS, I don't have much knowledge on the subject, but they're refusing to help me. They gave me a broken thing and they're expecting me to either fix it or ask them to move to a KVM. So please, just tell me what to do and I'll do.

EDITED: Oh sorry, I didn't notice the "If it's really gone, you can always get a new one." before. Testing now.
 
Last edited:
Back
Top