Install a theme in local machine. Should I need the FTP data connection? - wordpress

I have just installed wordpress at my localhost for the first time.
I want to install a theme, and it asks me about my FTP username and password.
It says this: "To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host."
I'm wondering if wp is usually directly installed in the production web server or if it could be installed first in a local machine... What should I do?

Add this to your wp-config.php
define('FS_METHOD','direct');
Due to Linux having such a more restrictive file system, this will enable to you write directly to the folder.
This will solve that ftp problem while installing a new plugin or theme.

On OSX, I used the following, and it worked:
sudo chown -R _www:_www {path to wordpress folder}
_www is the user that PHP runs under on the Mac. (You can change this to whatever your PHP install runs under on your specific OS)
(You may also need to chmod some folders too. I had done that first and it didn't fix it. It wasn't until I did the chown command that it worked, so I'm not sure if it was the chown command alone, or a combination of chmod and chown.)

If WordPress asking hostname and connection details for installing plugin and themes, we need to add a function hook in the wp-config.php file in the home directory.
define('FS_METHOD','direct');
for more details refer the page.
https://support.cloudways.com/how-to-resolve-wordpress-asking-for-ftp-credentials-error/

If you're using your local machine as the install location, instead of using the in-app installer (which is now askign you for ftp details), fire up a browser and download the theme directly from the Theme Directory, unzip it into the themes folder at wp-content/themes/name-of-theme. You can then activate the theme from the admin panels.
See also the instructions at http://codex.wordpress.org/Using_Themes.

Related

Giving write permission back to Wordpress on AWS EC2 via PuTTY

I recently had a PHP syntax error that crashed my server after using the plugin editor on my Wordpress website. It is an AWS Elastic Beanstalk hosted website, so I had to use PuTTY to change the file permissions and allow ec2-user to read/write durring SFTP via Filezilla.
I am not experienced with his sort of thing and followed the information from this question to accomplish this task.
Everything went well, but now I cannot edit or "write" anything via my Wordpress website. No plugin updating, no file editing, nothing. It says I need to change my permissions.
Due to my lack of knowledge on this, I have no idea how to reverse what I did when I entered
chown -R ec2-user /var/app
chmod -R 755 /var/app
How do I set the permissions back so I can edit files and update plugins via Wordpress admin?
EDIT: I found out that all I did was change ownership of the files to ec2-user. SO I guess my new question is how do I find out what username to use for my WordPress site to give it back ownership of the files?
Fixed:
I wound up adding
echo(exec("whoami"));die();
to the top of my WordPress index.php file to figure out the user. Make sure to remove it once you're done.
Lets say my username wound up being "foo".
After I had the username, I went back into PuTTY, and ran
sudo chown -R foo /var/app
and can now modify files through wordpress again.

Not able to add plugins

We have a blog setup on WordPress and our server is a linode instance which we connect through ssh.
Now when I am trying to add yoast plugin it is asking me for FTP credentials and when I am entering them still it is not connecting.
Please advise on this as we are not able to add plugins to our site.
This is a permissions issue with your server, run the following command in your SSH terminal:
sudo chown -R www-data:www-data /var/www
This will grant your WordPress sites the permanent ability to add/update plugins and themes.
It might be Permission issue. Try these simple steps:
1: Open Filezilla and after entering FTP Access, connect to directory
where your wordpress files exist.
Now right click on the Parent Folder of your wordpress installation and click on "Change Permission" Now enable Read/Write/Execute.
Now try again with Yoast Plugin. It should Work.
https://codex.wordpress.org/Changing_File_Permissions
Let us know if it worked.

No Write Access on Wordpress Folder permissions for Bitnami running on AWS

I recently migrated my Wordpress sites to Bitnami on Amazon Web Services. Everything it up and running from the user's perspective, but I'm struggling with a minor permission issue with the themes folder. When I download (or upload my own) theme, it doesn't have write permissions. Bitnami has this as the default for security purposes but when I had my stuff hosted at GoDaddy, this issue never came up.
The odd time I like to go and edit a theme file directly from Wordpress. I also have a File Manager plugin installed that I'll sometimes use instead of FTP to upload theme files.
I can manually change the permissions, either in FileZilla or using SSH but my curiosity and stubbornness would like to have write permission by default on any themes, new or existing.
Do I need to edit a config file somewhere to make this happen?
You need to connect to your server via SSH and execute the commands below described in order to assign correct permissions definitively:
sudo chmod -R g+w /opt/bitnami/apps/wordpress/htdocs/wp-content
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content
Then check again if your themes works as you expected.
You can read our documentation to clarify all this situation: https://docs.bitnami.com/general/apps/wordpress/

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

Wordpress plugins it asks for FTP Details

While I am trying to upgrade the wordpress plugins it Asks for FTP Details.
I have added the following to wp-config.php
define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', 'host address');
It has worked fine.
But I have multiple websites working on my virtualmin server. All the wordpress site is having the same wordpress plugin issue. So is there any other fix that could resolve the Issue?
I just found these: link 1 and link 2, where I dug out this:
WordPress asks for your FTP credentials when it can't access the files directly. This is usually caused by PHP running as the apache user (mod_php or CGI) rather than the user that owns your WordPress files (suPHP or FastCGI). Switching over to using suPHP or FastCGI would probably fix it. Of course, if you don't want to mess with that, you can always just put your FTP credentials directly in wp-config.php or use this in the shell:
pae$ cd /var/ww
pae$ sudo chown -R www-data:www-data wordpress
The best way to deal with wordpress installation on apache is to use the secondary user and group to apache which would not cause these issue while updating or installing plugins and using other wordpress functions.
just change your apache config file User and Group to your username and group name
User [yourusername]
Group [yourgroupname]
In wp-config just write
define('FS_METHOD', 'direct');
Are you hosting your WordPress sites on one of those hosts where WordPress asks you to provide FTP details before upgrading itself or upgrading plugins?
So Now WordPress will stop asking you for FTP details Here’s how you can do it
Open your wp-config.php file locate in your wordpress root directory
And copy and past below detail after your database detail block in wp-config.php file
define(“FTP_HOST”, “ftp.yourhost.com”);
define(“FTP_USER”, “ftpusername”);
define(“FTP_PASS”, “ftppassword”);

Resources