Any plugin installation failed - could not copy file error - wordpress

everytime I install a new plugin for wordpress it says Could not copy file and the files address. Does anybody know why this is the case.

Check file premissions and (important!) file owner or group. If you use apache server group must be www-data (default). This can be a solution

I was facing the same issue but in my case I was updating using FTP.
I fixed it by setting the hostname to "localhost" instead of using the IP.
This is because there was a loop happening and making the file upload fail and that's logged in the /var/log/vsftpd.log

Related

How to solve this error in moodle ? and setup in localhost?

Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.
You need to check 'config.php' in your moodle installation files directory.
There you can find a line like below, which shows your directory name (it seems empty as per your error, you need to define path here) - in this directory/folder your moodle media uploads get store.
$CFG->dataroot = '/var/moodledata';
Moreover, after define this you will require to give Read,Write,Execute permissions to this folder.
(here '/var...' mentioned as Ubuntu directory structure, in localhost you need to mention respectively)

Change the Wordpress URL

I would like to change the URL for my Wordpress:
From this: www.example.com/wordpress
To this: www.example.com/game
What do I need to do?
I tried renaming the Wordpress folder to game but this did not work. It caused a linkage problem with the bank-end database.
which server you are using.
if you are using apache or nginx you need to modify you vhost files accordingly to point to the right directory.
location of these file depend on you server's OS.
commonly it is in /etc/httpd/conf.d/ or /etc/apache2/conf.d/
Not open any file in this www.example.com/wordpress folder, Change permission this folder apply 755 permission, stop apache server or stop xampp. after rename your foder name and start apache server or xammp

"Unable to create directory wp-content/uploads" in wordpress?

I encountered this problem when I am trying to upload image files to my wordpress. I am using XAMPP on a Mac OSX Mavericks. I also upgraded to the latest wordpress version (3.8.1). I already tried the ff methods to solve this:
Method 1: I added the ff codes to the wp-config.php
define('UPLOADS', '/migsmarbella.com/wp-content/uploads');
define('WP_CONTENT_URL', 'http://migsmarbella.com/wp-content');
"migsmarbella.com" is the name of my wordpress folder.
Method 2: CHMOD the particular folder "migsmarbella.com" using Terminal Utility
sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/migsmarbella.com
Method 3: I also checked the "migsmarbella.com/wp-content" folder's permission settings (Right Click then "Get Info") which stated that "user" can read and write files, while "staff" and "everyone" can only read files.
Method 4: I unchecked the "Organize my uploads into month- and year-based folders" checkbox, then saved the setting changes inside Settings > Media.
Are there any better methods out there? Please help. Thanks.
P.S. Method 2 didn't work especially since it restricted my permission settings I have to undo the command I did by changing "nobody" into my mac's username.
Additional:
It seems this whole changing permission settings is getting more and more confusing. Can you guys give me the first step, the exact way to change permission settings of a folder in MAC? I tried to use Filezilla but I cannot find the command to chmod folders, at least in the Mac version.
First I'm using XAMPP for OS X 1.8.2-5 running the apache, mysql and ftp services, also the new wordpress 4.0, so I added this to my wp-config.php:
define('FTP_HOST', 'localhost');
define('FTP_USER', 'daemon'); /* check the user at XAMPP_dir/xamppfiles/etc/proftpd.conf */
define('FTP_PASS', 'xampp'); /* also the password is at XAMPP_dir/xamppfiles/etc/proftpd.conf */
define('FS_METHOD', 'ftpsockets');
define('FTP_BASE', '/XAMPP_dir/xamppfiles/htdocs/wordpress'); /* check/mod your path */
Also the ownership, hope this helps
After trying everything, I fount out this way to solve it which consisted in getting the actual username of the server. I wrote a small php script for this:
<?php
echo '<pre>';
$user = system('whoami', $retval);
echo '
</pre>
<hr />Ultima linea de la salida: ' . $user . '
<hr />Valor de retorno: ' . $retval;
?>
I ran it at http://localhost/wordpress/test.php and got the username daemon. I then changed the permissions to this user sudo chwon daemon -R wordpress and solved!
From your code you no need to define the path of your website as like migsmarbella.com Not sure why you targetting the path as with your site url? It take automatically of your corresponding site path you don't even put a path including your site url.
Your code of defining the path is not the correct way
define('UPLOADS', '/migsmarbella.com/wp-content/uploads');
define('WP_CONTENT_URL', 'http://migsmarbella.com/wp-content');
Correct way is as below.
Open up your wp-config.php file, located at the root of your WordPress installation, and add the following code
define('UPLOADS', 'wp-content/yourfoldername');
The codex specifies that it should be added before the line that says require_once(ABSPATH.’wp-settings.php’);.
If the directory that you are defining does not yet exist, WordPress will automatically create it as long as wp-content is writeable. Otherwise you can just go in and create the directory yourself via FTP. Make sure to make the new directory writeable.
Change upload organization
You can also change the way WordPress uploads are organized. Navigate to Settings > Media in the dashboard and you’ll find the option to check or uncheck the box next to “Organize my uploads into month- and year-based folders”.
The path you gave when doing chown is invalid. Paths are case sensitive.
Please also be aware there is a difference between chmod and chown.
Path should have been /Applications/XAMPP/xamppfiles/htdocs/migsmarbella.com
Run the following commands in terminal:
mkdir /Applications/XAMPP/xamppfiles/htdocs/migsmarblla.com/wp-content/uploads
sudo chown -R nobody:staff /Applications/XAMPP/xamppfiles/htdocs/migsmarblla.com/wp-content/uploads
The first creates an uploads folder since one doesn't already exist.
The second changes its ownership so folders can be created and files added by WP. Changing the ownership of the entire install will cause issues when you modify files. This only applies the change to the uploads dir.
In the recent version on xampp-7.2.6 in mac osx, the lampp process is running as daemon user.
And your wordpress folder might not have permissions to create the plugin folder in the directory. In order to resolve this issue, I changed the permissions of the webiste folder.
chmow daemon -R website
It worked.

Permission denied error in wordpress 3.3.1

I once moved my wordpress directory one level up on my server (its now in the root). Everything seems to work fine for a while but niow i'am starting to have troubles with uploading images.
When i try to include an image by uploading it from my computer wordpress throws an "Permission denied" error:
copy(/home/bram/domains/dutchmountaineer.com/public_html/wp-content/uploads/2012/05/Costa-Rican-Frog.jpg)
[function.copy]: failed to open stream: Permission denied in
/home/bram/domains/dutchmountaineer.com/public_html/wp-admin/includes/file.php on line 348
618
I tried setting the uploads and includes folder to 777 which had no effect. I have set them back to 755.
Any help please!
Jorrit
EDIT:
I tried changing the full path (in media settings) but it was of now help. I think it since i moved the wp installation from /wp/ to the root of my server
Check who owns the directory. It may be possible that you need to add www-data to the group. Weird, yes, but I sometimes encounter scenarios where even files and directories with 777 are denying me access if I don't add my user to the owner group.
It means you are getting error near this code
// Copy the temporary file into its destination
$new_file = $uploads['path'] . "/$filename";
copy( $tmp_file, $new_file );
unlink($tmp_file);
check your settings under settings->Media tab in admin panel and check you have the appropriate permissions for the folder, you can change the upload path as well. Let me know if problem still persists.
You have to allow uploads directory 777 rights and check your folder user and ftp user are same or not.

WordPress update failing

I'm having a problem when trying to update WordPress to the latest version I get the following error:
Download failed.: Destination directory for file streaming does not exist or is not writable.
Installation Failed
I'm also having the same problem when uploading images, it fails and gives the following error
has failed to upload due to an error
The uploaded file could not be moved to "the website path and then uploads directory"
I have checked the permissions of the folders and the folders themselves are set to 755 & the files inside them set to 644.
Could anyone tell me why it would be doing this?
Where running a plesk server.
Thank You,
Mark
Are there any more error messages, probably also in the servers log files? Probably the download for the update should be done to /tmp and you are not allowed to store files there? Try setting the constant WP_TEMP_DIR which should change the directory. Put something like this in your wp_config.php:
define('WP_TEMP_DIR', ABSPATH . 'wp-content/');
The permissions you're using seem reasonable, but they will only work if the FTP user that WordPress is using (set in your wp_config.php file) is the same as the owner of those files/folders.

Resources