Unable to create directory while adding pictures - wordpress

I have the following issue in WordPress whenever I upload pictures. I have already added the following
code to wp-config.php
define( 'UPLOADS', 'wp-content/uploads' );
but still, I get this issue
"Unable to create directory wp-content/uploads/2021/03. Is its parent directory writable by the server?"

Related

How can i make my own error log file in wordpress? ( not with WP_DEBUG_LOG )

i'm trying to create a wordpress plugin that imports some products and i want to be able to log any errors that occur, in a text file. I know that error logging already exists using:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
but i want to make my own file logging only the errors that occur from my plugin.
How can i do that?
You can log errors directly to a .log file in your plugin directory as mentioned here: https://wordpress.stackexchange.com/questions/291108/how-to-log-plugin-errors-to-plugin-error-log-file
If you insist to write to a 'text file' then you can use this method:
Write from WordPress plugin to text file with PHP
Make sure the folder you are writing the errors to has the correct permissions.

Wordpress Upgrade failed. Admin panel not working

I wanted to Upgrade the Wordpress installation, I clicked on the Upgrade to latest version link from my WP ADMIN panel and post that it has asked me to give FTP details for the Update for which FTP details were entered and Upgrade started. After few minutes I got Below ERROR and Now WP ADMIN is not loading. I tried to clear browser cache and cookies but still not working. Please Help in resolving the issue.
There has been a critical error on your website. Please check your site admin email inbox for instructions.
Learn more about debugging in WordPress.
I have further tried to debug and added below code in wp-config but i am not getting any errors on the page neither in the path /wp-content/debug.log file
is there.
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
#ini_set( 'display_errors', 0 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
Reference : https://wordpress.org/support/topic/wordpress-upgrade-failed-wp-admin-panel-not-working/
Dear users, please use manual update if you can’t update automatically.
See here:
Updating WordPress
You can do it with cpanel:
Simple copy wp-content & wp-config.php to a directory out of public_html (for example, create a folder by name “backupold” and put files in it)
Download latest version
https://wordpress.org/latest.tar.gz
Upload it in your wordpress directory (output file will be in public_html/wordpress for example)
Copy (backuped contents) “wp-content” folder & “wp-config.php” file to “wordpress” folder & replace
Move all files and folders from “wordpress” folder to your site directory (by default, public_html) & replace.
Now enjoy!
Warning: do a backup before, and do as i sayenter code here

Wordpress update failing with Internal Server Error

Version -
WordPress 4.7.12 running Twenty Seventeen theme with Plesk Onyx has Web Windows Hosting Application
Error
When I login into Dashboard and select "Update" option for upgrading WordPress installation to 5.1, it loads for some time and then shows an error message:
The page cannot be displayed because an internal server error has
occurred.
There's no other text except for this.
Wha I've tried so far
I attempted to enable logging by adding the following three attributes into the wp-config file, but no debug file gets generated into the wp-content folder. I checked IIS logs, but couldn't see logs file updating.
define('WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
Deactivated all plugins - Problem persists
Please suggest options to fix this or get more details.
I think that that's what error logs are for.
Try to create .user.ini or php.ini files in the same directory contains
error_log = phperrors.log
(absolute path is preferred)
And, then run your script again and then check for the same file.
Thanks

Wordpress Default Directory Change

I am trying to change the default path of the WP default directories such as wp-content, wp-include etc to avoid wpscan.
I have tried using plugin would it possible to perform the same using manual techniques. I am using apache as a web server.
An example, I have tried:
RewriteRule ^cms_plugins/(.+) /wordpress/wp-content/plugins/$1 [L,QSA]
Thanks
Try the following steps to rename WP-Content Folder
Download the WP-Config.php file
Open and Edit the Wp-Config.php file to add the below line
define( 'WP_CONTENT_FOLDERNAME', ‘new_directry_name’ );
Change 'new_directory_name' to the name you want for your content folder.
Upload WP-Config.php file back to your server
Follow these steps to replace the WP_Content folder
Download WP-Config.php file
Open and add the below lines
define( 'WP_CONTENT_DIR', ‘new_directry_local_path’ );
define( 'WP_CONTENT_URL', 'http://new_directry_url' );
Change new_directory_local_path and http://new_directory_url to your local path and URL.
Upload back to your server

Wordpress upload theme

I was trying to install wordpres on my local computer. However, when I try to upload a theme or install some plugin using the web interface. It always prompts me to enter FTP credentials. I checked online, and it seems that ftp credentials is not necessary for uploading. I set the permissions for all directorieos and files under wp-content to be 777, but the problem is still there. And this Word press is a fresh installation on ubuntu 14.04( running in a VM) and newest wordpress.
Hi I got this issue before some time wordpress ask ftp detail when I was trying to install new plugin and get resolved by adding this code in my wp-config file.
define( 'FS_METHOD', 'direct');
Add this code to wp-config.php :
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );

Resources