Page 1 of 1

some problems uploading media files w/ error about temporary folder

PostPosted:25 Sep 2018 23:05
by pauloficaadica
Hello!

I'm having some problems uploading media files in wordpress.

I have followed some tutorials on correcting this in Wordpress but I feel that this may be a problem in VPSSIM.

I think the problem is in the VPSSIM because I did some testing with the same backup site on my server with cPanel and I had no problems.

The problem:
When I send an image to the Media Files in Wordpress I get the error that a temporary folder is missing.

As I've tried to resolve:
I have followed the tutorials to include in the wordpress configuration file and create the /temp/ folder with permissions, but this doesn't always work, actually, most of the time, this definitely doesn't work.

Below is the code that I found to try to correct, but as mentioned, this doesn't work:

define('WP_TEMP_DIR', dirname(_FILE_) . '/wp-content/temp/');

Save your changes and upload the wp-config.php file back to your website.

Next, you need to go to /wp-content/ folder and create a new folder inside it. You need to name this new folder temp.

Re: some problems uploading media files w/ error about temporary folder

PostPosted:26 Sep 2018 06:42
by nguyenoanh
Hello !
After upload code to website, you need set chown to it
Code: Select all
chown -R nginx:nginx /home/domain.com/public_html
or using the function Fix Error Chmod, chown in Add Website & Code
=========================================================================
        VPSSIM (4.6.0.4) - Manage VPS/Server By HTTP://VPSSIM.COM
=========================================================================
                        Add Website To Server
=========================================================================
             VPSSIM Support Both WWW And Non_WWW Domains
=========================================================================
Auto Backup:  ALL Websites = OFF | ALL Databases = OFF || OFF = Not Safe
=========================================================================
Note: http://go.vpssim.vn/noteaddweb
=========================================================================
 1) Add Website
 2) Add Park & Redirect Domain
 3) Add website + Wordpress (Auto Setup)
 4) Add website + Wordpress Code
 5) Add Website + Forum Code
 6) Add Website + Opencart Code
 7) Add Website + Joomla Code
 8) Them Website + Drupal Code
 9) Add website + Sypex Dumper (Data Backup)
10) Add website + MySQLDumper (Data Backup)
11) Add Website + YourLS (URL Shortener)
12) Fix Error Chmod, chown
13) List & Size of All Websites
Type in your choice (0-Exit): 12
=========================================================================
You must use this function after upload code website to server.
-------------------------------------------------------------------------
This function will set permission writable for Nginx, PHP-FPM to the code
-------------------------------------------------------------------------
you uploaded. If do not run this function, website can has error:
-------------------------------------------------------------------------
can't Write , Unable to install fixes , unable to upload, upgrade plugins,
-------------------------------------------------------------------------
themes, asking FTP password when update plugins, themes.
=========================================================================
CHOOSE SET PERMISSIONS FOR 1 OR ALL WEBSITES
-------------------------------------------------------------------------
Set permissions for all websites: Maybe take a longtime
-------------------------------------------------------------------------
Set permissions for 1 website: faster but you must type in website.
=========================================================================
1) Set the file permissions all websites
2) Set the file permissions for 1 website
Type in your choice (0-Exit):

Re: some problems uploading media files w/ error about temporary folder

PostPosted:23 Nov 2018 05:46
by pauloficaadica
Hello friend, I've been having problems with this again, so I've done several tests and I'll color down what I did to get the errors, I'm sure this is a vpssim problem.

1) After 1 or 2 days, I can't send files through wp-admin

2) So I just follow your tip to fix permission errors

3) I go to wp-admin and I can't upload.

4) Then I go to the vpssim and delete every cache, and that's it! Works, now I can send images/upload again.

Right, with what I said above the problem looks like caching, but this is weird, because I have this problem on sites that are under development and does not receive any traffic, so I keep thinking what kind of huge cache can be created in a vps with 4GB of ram and not allow uploading of files.

The problem is the ngnix cache and not allowing folders (if they are correct of course).

So, a complement to this.

I have a script to clear the cache every day, so I think I should not have this problem, see the following script:

#!/bin/bash
service nginx restart
service php-fpm restart

#Clear Redis Cache / uncomment to use command
( echo "flushall" ) | redis-cli

#Clear Memcached Cache / uncomment to use command
echo "flush_all" | nc 127.0.0.1 11211

Re: some problems uploading media files w/ error about temporary folder

PostPosted:23 Nov 2018 09:07
by nguyenoanh
pauloficaadica wrote:
23 Nov 2018 05:46
Hello friend, I've been having problems with this again, so I've done several tests and I'll color down what I did to get the errors, I'm sure this is a vpssim problem.

1) After 1 or 2 days, I can't send files through wp-admin

2) So I just follow your tip to fix permission errors

3) I go to wp-admin and I can't upload.

4) Then I go to the vpssim and delete every cache, and that's it! Works, now I can send images/upload again.

Right, with what I said above the problem looks like caching, but this is weird, because I have this problem on sites that are under development and does not receive any traffic, so I keep thinking what kind of huge cache can be created in a vps with 4GB of ram and not allow uploading of files.

The problem is the ngnix cache and not allowing folders (if they are correct of course).

So, a complement to this.

I have a script to clear the cache every day, so I think I should not have this problem, see the following script:

#!/bin/bash
service nginx restart
service php-fpm restart

#Clear Redis Cache / uncomment to use command
( echo "flushall" ) | redis-cli

#Clear Memcached Cache / uncomment to use command
echo "flush_all" | nc 127.0.0.1 11211
Hello.
Please update VPSSIM to lastest version, in the main menu, you can see the inodes status.
Maybe your VPS full of inodes.

Re: some problems uploading media files w/ error about temporary folder

PostPosted:23 Nov 2018 09:32
by pauloficaadica
okay, i will