WordPress Asks for FTP Details While Installing Plugins

When you setup a WordPress on Ubuntu Linux and try to install a new plugin from plugin repository it prompts you for FTP Details.

With a few Google searches I managed to find a solution for this problem. To fix this issue all you need to do is run the following command on your terminal.

sudo chown -R www-data:www-data /[folder-path]/[name-of-your-project-folder]

You can also fix this issue by adding following line to your wp-config.php file.

define('FS_METHOD', 'direct');

See Also: How to Get Featured Image Thumbnail URL Using WP REST API

Git Ignore File Permission

When you clone a git project on Ubuntu, you need to change its permissions to make it editable. The problem with doing this is by default git tracks file permission changes and consider it as modification in file. However, there is simple trick which you can use to stop git to ignore changes in file permission.

We can force git to ignore file permissions by running this command inside your terminal.

git config core.fileMode false

You can also set it as global cofiguration by using following command.

git config --global core.filemode false

See Also: Remove Author From WordPress Recent Comments Widget

Installing Git on Ubuntu

In this tutorial, we are going to install Git version control system on Ubuntu. To install Git on Ubuntu follow the steps given below.

Step 01.

In the first step, you need to add PPA to your Source list.

add-apt-repository ppa:git-core/ppa

Step 02. 

Now run the following command to update your soruce list

apt-get update

Step 03.

Now, run the following command to start the installation process

apt-get install git

Read More: How to Remove a Package From Laravel Using Composer

How to Install LAMP on Ubuntu

In this tutorial, we are going to install LAMP (Linux, Apache, MySQL and PHP) on Ubuntu OS.

To install LAMP on Ubuntu follow the steps given below,

Step 1:

The first thing we need to do is install Apache web server. To do this run the following command within your terminal.

sudo apt-get install apache2

Step 2:

In the second step, we are going to install MySQL. This can be done by running the following command.

sudo apt-get install mysql-server

Step 3:

Next thing we are going to do is install PHP on our computer. We do this by using following command.

sudo apt-get install php5 libapache2-mod-php5

Step 4:

By default, after installation Apache server automatically gets restarted. If it doesn’t run the following command.

sudo service apache2 restart

To check if the installation was successful, open your web browser and type following URL. After successful installation it will display a “It works” message.


Useful Read : How To Set Up mod_rewrite for Apache on Ubuntu

How to enable mod_rewrite in Ubuntu

To enable Rewrite module in Ubuntu run the following command within your terminal.

sudo a2enmod rewrite

In order to apply the changes you need to restart your Apache.

sudo service apache2 restart

If you are planning to use rewrite via htaccess file, open the apache configuration file.

sudo nano /etc/apache2/sites-available/000-default.conf

In this file look for,

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted

Replace AllowOverride None with AllowOverride All. 

To apply changes, restart your server again.

sudo service apache2 restart

Useful Read : Change Default Namespace For a Laravel Application