How to install new WordPress theme on Ubuntu in XAMPP? - wordpress

I am new to WordPress. I just installed on my Ubuntu with XAMPP on localhost not live server.
My WordPress version is 3.5.1.
Now when I try to install new theme it shows the below message
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.
And prompts for hostname, ftp username and ftp password.

Are you trying to install the theme over the web or you have a local copy of it?
You can check this link that describes your issue to some extent:
http://www.jasong-designs.com/2012/01/14/ubuntu-linux-permissions-and-a-local-wordpress-install/
and this too:
http://www.chrisabernethy.com/why-wordpress-asks-connection-info/

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 new plugin or theme.

try using the username: nobody and the password: xampp or root or toor or**
your localhost password [if not blank]
**

Related

Unabel to login to wordpress's admin area when tried to install the backup on Xampp (ubuntu 18.04)

I have recently a problem with my website which was built on WordPress. Therefore I decided to install xampp on my Ubuntu 18.04 and try to tackle the issue on a localhost. I did make a new user using "privileges" tab on localhost/PhpMyadmin and did "sudo mv wordpress /opt/lampp/htdocs". So my old website could be linked to the new database. My old website is now accessible through http://localhost/wordpress/ but it does now show all the contents and lack many things. It also does not let me to enter the Admin area through the login address. I should mention that While my webpage was working properly I did change the login address from .../wordpress/wp-admin/ to .../wordpress/loginWebName.
Please try following steps.
Install WP-CLI
Follow: https://wp-cli.org/#installing
Go to the Wordpress site folder in terminal
Using: cd /path-to-wordpress/
Configure wp-config.php with new database password
Use below command to replace your existing siteurl to new one.
wp search-replace "existing-url" "new-url"
If you are working on localhost new-url will be localhost/relative-path-to-wordpress.
Check site-url value in wp_options table for existing-url

Being redirected to 127.0.0.1 from Wordpress/Apache installation with AMPPS

I have installed AMPPS (Apache + MysQL) with Wordpress on a Windows 10 computer to quickly setup a website. The website is working fine locally.
Now, the problem that I have occurs when I try to access the website from another computer.
When I enter the server IP ( http://219.223.239.3/ ) on another computer, a main webpage show with the main directories:
This indicates that the other computer can connect to the server.
However, when I try to access the WordPress subdirectory on the server ( http://219.223.239.3/wp/ ), it redirects to http://127.0.0.1/wp/ and the webpage does not show. Hence, it seems that there is some configuration problem with WordPress or Apache.
To try to solve the problem, in Wordpress, I went to Settings>General, and I have set the "Wordpress Address" and "Site Addresss" to http://219.223.239.3/. Moreover, I have edited the Apache configuration file to change "ServerName" to 219.223.239.3:80. But it still does not work.
Otherwise, all the settings should be the default settings of AMPPS.
I am not very familiar with Apache.
Does anyone knows how to solve this issue?
Check the wp-config.php file in the root of your wp folder. I had the exact same problem and it turned out the credentials for establishing a connection to the MySQL database I had running locally were incorrect.
In the Ampps management console (typically located at localhost/ampps/ in your brower), open up PHPMyAdmin and check the user credentials for the database connection.

wordpress asks for ftp password while installing plugins

I have a centos with user anamika with ftp loging.
I create wordpress folder loging with user anamika in webroot directory. User anamika has apache as primary group. The create folder gets user of anmika:apache when create.
When I try to install plugin it asks for ftp login.
When I changes user from anamika:apache to apache:anamika it works fine.
Please suggest a way to solve this user issue.
I checked following suggestion and wordpress blogs but didn't worked.
Wordpress plugins it asks for FTP Details
Wordpress asking for my FTP credentials to install plugins
Installing plugin for wordpress website hosted locally is asking for ftp details
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');
You can use Paste the following code to your wp-config.php file,
preferably just below every other line of code to install plugin without ftp details...
define('FS_METHOD','direct');
The issue was with the permission of the user apache. I changed the user and group of the apache in httpd.conf file to the ftp user and it solved the issue.
Changed User apache Group apache to User anamika Group anamika

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”);

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

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.

Resources