How can I make my ftp directory writable for wordpress plugin update? - wordpress

I try to update a plugin in wordpress.
When I press on "update" they ask me for my ftp settings.
Then the Plugin tries to update and I get the error
Update failed: Directory could not be created.
I changed the folder permissions on 770 recursive for the plugins folder. But still not working.

Generally if this happens I like to reset all the file/folder permissions on the site https://gist.github.com/Adirael/3383404 is a sh file that will do this, if you dont have ssh access a lot of dashboards will have a reset permissions utility that may do the trick.
Alternatlvy find out the FTP credentials for the site and complete the form this should work.
There are extensions that claim to be able to do this however I would advise not using them as the process is pretty simple and they may introduce other issues especially as from the sounds of it you wouldnt be able to install the extensions.

Related

Server ftp write errors

We have a linux based server through which we offer a hosting service. We have a problem with WordPress and other platforms. each wordpress site asks FTP accounts every time you install WordPress, themes, add ons or to try to upgrade it .
We need to get write access to the wordpress , joomla , drupal , etc. platforms automatically when its installed to customers server space via softaculus .
I have no experience of the hosting service, im just make websites, and I've tried to make the ftp accounts wp -config file, but it does not fix the other customer sites and when added to the wp -config file, it is not the best solution (Still asks for a password when install theme, add ons or update anything)
Sorry for bad english. can anyone help me to get this problem fixed?
We need write acces for: Joomla, Wordpress, Drupal, Magent ETC bases. We have c-panel acces for every customer and softaculus installer for wordpress etc platforms
When you get the error message, web server needs to get write access to the WordPress files. So you can add write access to the files, I think the problem will resolved.
If you couldn't add write access to the files, you would contact your hosting service center.
It's most likely the permissions problems here.
You need to be sure that your webserver can read all files and folders in the web root folder and you need to make every user the owner of each folder and files.
Using cPanel it should be done automatically when you create FTP user and providing it's home directory. If you have a mess with permissions already you may need to edit them manually. You can try to set 644 permission for all files and folders and then change owner to the actual user.
Look here for more information about file permissions on Linux, it should help.
Its been fixed, I set on apache write access different so its now working probably!
Link for details:
https://wordpress.org/support/topic/folder-permission-on-linux-ubuntu

WordPress on MAMP wants WebFTP for updates. Where can I find this?

I've installed WordPress on my local machine with MAMP.
If I want to updates the system or plugins, WordPress asks for WebFTP credentials every time. I've tried root/root on localhost and localost:8888. Both are wrong?
Where can I find/set these credentials?
Or is there a way to prevent WP from asking?
The issue is new for me. In the past there was no need for WebFTP credentials?!
I've always told WordPress to edit files directly for updating WordPress instead of using FTP. To do that add define('FS_METHOD', 'direct'); to your wp-config.php file and then make sure that the files are owned by the user that runs Apache. I think that by default the free version of MAMP runs as you so you shouldn't need to do anything different with file permissions.
Below is the documentation from WP's Editing wp-config.php documentation page for FS_METHOD constant.
FS_METHOD forces the filesystem method. It should only be "direct",
"ssh2", "ftpext", or "ftpsockets". Generally, you should only change
this if you are experiencing update problems. If you change it and it
doesn't help, change it back/remove it. Under most circumstances,
setting it to 'ftpsockets' will work if the automatically chosen
method does not. Note that your selection here has serious security
implications. If you are not familiar with them, you should seek help
before making a change.
**(Primary Preference) "direct"** forces it to use Direct File I/O requests from within PHP. It is the option chosen by default.
**(Secondary Preference) "ssh2"** is to force the usage of the SSH PHP Extension if installed
**(3rd Preference) "ftpext"** is to force the usage of the FTP PHP Extension for FTP Access, and finally
**(4th Preference) "ftpsockets"** utilises the PHP Sockets Class for FTP Access.

Wordpress requires FTP information to update plug-ins

I'm trying to update Wordpress plug-ins, and I'm presented with the familiar FTP login screen.
I have read other posts indicating the lines in wp-config.php to be filled in. However, I don't have FTP installed on this server, just SFTP.
Also, I don't want to have to do this for each Wordpress install.
As far as I know, wp-content is already owned by apache:apache, and PHP is also running as user apache.
Is there something I'm missing? Is there some other way to handle this?
This has happened to me alot, when installing wordpress on my own server. Usually it has to do with a permission problem.
A lot webservers use the user www-data, instead of apache. So check your apache configuration for what your webserver user is set to.
Also you will want to check your directory permissions, and make sure both the user and group has read, write, and execute access. I am not sure if execute access is necessary, but that is usually what I set my server too.
You can do this with the command
chmod 775 -r your_wp_content_directory
And if all else fails, if you have shell access you can also use wget in the directory to install plugins.
After trying everything I could find regarding permissions, I added the following line of code to this site's wp-config.php:
define('FS_METHOD', 'direct');
That immediately solved the problem. Not sure if I also needed to modify the permissions first, since i did that before trying this fix.

Could not remove the old plugin

I'm trying to update the plugins on my clients site and I'm getting this error for multiple plugins. He's using plesk.
Downloading update from https://downloads.wordpress.org/plugin/awesometastic.131026.zip…
Unpacking the update…
Installing the latest version…
Removing the old version of the plugin…
Plugin update failed.
An error occurred while updating Awesometastic Plugin: Could not remove the old plugin.
I'm sure it's got something to do with directory permissions, although, could someone explain to me what the possible issues are and how to fix this?
Thanks!
It's a permissions issue. Run this on SSH:
chmod -R 0755 /var/www/<yourpathtowordpress>/wp-content/plugins
chown -R www-data /var/www/<yourpathtowordpress>/wp-content/plugins
The first grants writing permissions, while the second ensures the user who needs the permission is correctly set
WordPress does not display OS level errors by default but this is most definitely a permission issue on your plugins folders in your site's wp-content/plugins.
You could enable debugging in order to see the original error which triggered the more generic one you've seen if you want to work with a better view of the world.
Multiple debugging options are documented in WordPress' online manual. To enable debugging and log messages set the following variables in wp-config.php:
Enable debugging via WP_DEBUG
define('WP_DEBUG', true);
Enable logging debug messages to the /wp-content/debug.log file with WP_DEBUG_LOG
define('WP_DEBUG_LOG', true);
You should probably make sure to disable these options and delete the debug.log file after gathering enough information as they could contain server information you do not want to be accessible publicly through your WordPress installation.
Alternatively we can try to guess what the most plausible cause can be:
If you installed your plugins manually on the server and not via the
WordPress administration console it is likely you did it as a
different user then the one who is executing WordPress' PHP code and
thus requires proper access to perform such OS operations.
Finally the solution may be to fix the permissions or upgrade the plugins manually.
Basically this is permission issue.
and you will have to provided or make FTP user as owner of the plugins folder.
Most of the cases where you will be using same user for WordPress install and run as well as FTP access. If you are using different users for both above purpose then providing ownership to FTP user will fix this issues just like that.
Ex:
chown -R ftpadmin /var/www/wordpress/wp-content/plugins
Hope this would be helpful if any body at this stage.
first you have to delete the old plugin than update
If you have SSH access to your blog
Login your site via SSH.
Use SSH commands to nagivate “../wp-content/plugins/”.
type the given command to see all files and folders in the plugin folder
ls -al
Search for the particular plugin folder in the list.
Next, type the given command to delete that folder.
In the command, replace the folder name with your plugin folder name which is you want to delete.
rm folder name
now you're able to delete your old plugin.
Hi this is the permission issue at wordpress so follow this command
sudo chmod -R 0777 /var/www/html/thewayivogue/wp-content/plugins
like this where thewayivogue replace to your folder name.
Open FTP ank kill em all :)
Then reinstall those plugins. It is better not to open admin panel while removed so you have it still activated.
But do backup. It can Save Willy

Mirroring a Wordpress *configuration* between local and remote

Ok, so I'm familiar with creating local Wordpress builds, and have been chugging along happily with the technique outlined in Smashing's MAMP-based article. My question goes a step beyond this.
The article is great for developing generic themes, but when developing sites (not necessarily blogs) based in Wordpress, for me at least, it's a little painful come launch day.
I have to go back in and reconfigure the server's Wordpress to match what I've already done locally. Settings have to be entered again, plugins need be installed again, menus recreated, and css will have to be altered to reference the unique classes/id's Wordpress generates for posts/pages/custom taxonomies…sometimes things are missed in the process. What I want to know is this:
Is there an easy way to automate cloning or mirroring the build on my local machine to the remote server?
Even if you have to just LMGTFY me, that would help. I don't exactly know what I should be searching for. Searches dealing with 'mirroring wordpress configuration' and 'cloning wordpress configuration' returns tutorials on moving content, which I know how to do.
If it helps, I'm running OSX 10.6.8 with xcode dev tools, git, ruby, node, and homebrew. All of my live servers have ssh access as well as ftp, and I build with the most current versions of Wordpress.
Here are some easy steps to follow:
Download and install the WP Migrate DB plugin.
Go to Tools > WP Migrate DB and fill-in the blank fields(New address (URL), New file path and optionally check/uncheck the other options). Click on Export Database and save the export file to your computer.
Make a .zip archive with ALL of your files(the /wp-admin, /wp-content, /wp-includes directories and all files in the root directory).
Upload that file to your production server, where you want your WordPress site to reside.
Go to your cPanel(or use the unzip command through SSH) File Manager(or any other alternative that you might have) and unzip the file that you just uploaded.
If you don't already have a Database set-up on your production server - create one through the hosting control panel(for cPanel, it would be Creating a mySQL database in cPanel, for plesk it would be Plesk 7 Tutorial: Creating a database, for anything else, just google it up, or try your hosting's FAQ). Remember/write-down your Database Name, Database User and Password.
Edit the wp-config.php file and change the values for the DB_NAME, DB_USER, DB_PASSWORD and optionally DB_HOST - but this is usually localhost - if that doesn't work try asking your web host, or if you have phpMyAdmin, log-in to it and look at the very top of the page - in this case the DB_HOST would be localhost.
After you've done all of that, log-in to your DB administration tool(most of the time this would be phpMyAdmin, but it could be something else as well) and upload the database export file that you save to your computer in step 2. Note: If your hosting hasn't provided you with a DB administration tool, I would suggest that you upload the phpMiniAdmin(click on the "Download latest version" link and save the file to your computer) script to your production server. Then go to that script(if your website is located at http://example.com/, go to http://example.com/phpminiadmin.php) and enter your DB details. On top of that page, you will see an import link. Click on it and upload your DB export file. Note 2: phpMiniAdmin doesn't support gzip-compressed files, so if you did check the Compress file with gzip option in step 2, you will have to re-do that step with this option unchecked.
Log-in to your site and go to Settings > Permalinks in order to update your permalink structure.
Check the permissions of the /wp-content/uploads and /wp-content/plugins directories - make sure that you will be able to upload images and plugins without any problems.
That's pretty much it. It might seem like a lot, but I follow this process for almost every site that I upload to production servers and it can take me as less as a bit under 10 minutes to do all of that(considering that I usually use custom MySQL commands, instead of the WP Migrate DB plugin - I should probably start using it :) ). Once you get used to the process and you don't encounter any low-quality web hostings, you should be perfectly fine with these steps.
Note: Since you used ssh as one of your tags, I assume that you usually have ssh access to the production server. If you don't I'm still assuming that you have a cPanel access(if that's not true and you can't unzip files on the server, then upload all files manually via FTP client, instead of doing steps 3 and 4).
I guess the only way is to copy the database or part of it.
What I do is to copy the relevant tables and modify manually the site URLs in table options. There are only 2. There is also a nice plugin velvet-blues-update-urls to modify all links, after the site URLs are set manually to be able to access the backend, in case posts are also copied.
Next, copy all theme directory files to the same directory in the site, assuming you are using the same theme.
Both processes can be automated with a PHP script.
I am not sure this is what you want, but hope this helps.
Not sure that this is exactly what you need, but to move a site you can use the built in Wordpress "export" and "import" options. As far as I remember there was an option when importing to change URL's and the import would change a few things for you.
Even if this does not answer your exact question, hope it helps.

Resources