Powershell Running Scripts (PS1) Error

When running some ps1 file in Powershell and you get some error like:

File <Path-to-some-ps1-file>.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.

You can solve it by running the following command in Powershell:

Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "RemoteSigned"

To reset the policy setting run:

Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "AllSigned"

Cheers!.

WordPress Errors and their solutions

Error:
$ sudo gzip -d /usr/share/doc/wordpress/examples/setup-mysql.gz
gzip: /usr/share/doc/wordpress/examples/setup-mysql.gz: No such file or directory

Sol:
The problem is the setup-mysql file has to be unzipped.
Code:
$ sudo gunzip /usr/share/doc/wordpress/examples/setup-mysql.gz
Then retry
$ sudo gzip -d /usr/share/doc/wordpress/examples/setup-mysql.gz
Problem will be solved!

Error:
Neither /etc/wordpress/config-localhost.php nor /etc/wordpress/config-localhost.php could be found.
Ensure one of them exists, is readable by the webserver and contains the right password/username.

Sol:
Create the file manually if it doesn’t exist.
But if it is there, then run
$ sudo ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-default.php

Error:
Error connecting to the Database

Sol:
Make a backup copy of wp-config.php file.
then run
$ sudo cp /usr/share/wordpress/wp-config-sample.php /usr/share/wordpress/wp-config.php
$ sudo gedit /usr/share/wordpress/wp-config.php
then enter your
database name
databsae user
database password
localhost name
save that file.

Error:
You can’t manually install themes and plugins and also automatic updates doesn’t work.

Sol:
For automatic updates to occur, the folder and all its files and subfolders must be owned by www-data:
$ sudo chown -R www-data /usr/share/wordpress
This command will automatically solve your theme and plugin installation problem.

Error:
Blank screen when you go to http://localhost/wordpress/

Sol:
This error usually occurs due to some faulty syntax or some irregularities with your file.
In the wp-config.php file, find the code
define(‘WP_DEBUG’, false);
set it to
define(‘WP_DEBUG’, true);
Now your browser will show the errors that could result in Blank Page Error.

Happy Pressing! šŸ˜€

Two most common errors

  1. Lock error:
    E: Could not get lock /var/lib/dpkg/lock ā€“ open (11: Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?The reason is quite obvious from the error itself ā€œanother process using itā€.The idea would be to look for another application which is being installed or update it. Wait for it to finish the installation or cancel it. If you cannot see the application then try running this command in the terminal to solve this error:
    $ sudo rm /var/lib/apt/lists/lock

    Any other type of lock can be removed using:
    $ sudo rm <address of error>

     

  2. 0%[waiting for headers]:
    Try restarting your system, and if the problem still presists then, run following commands in terminal
    $ sudo apt-get clean
    $ sudo apt-get update
    P.S- You can runĀ upgradeĀ command after update as “apt-get upgrade” upgrades what you have on the system already but doesn’t introduce new packages unless absolutely necessary.