SSH into the website document root and install drush:
1 |
composer require drush/drush |
Use drush to reset admin user password:
1 |
./vendor/bin/drush user-password admin --password=[newpass] |
SSH into the website document root and install drush:
1 |
composer require drush/drush |
Use drush to reset admin user password:
1 |
./vendor/bin/drush user-password admin --password=[newpass] |
These steps assume that wp-cli is installed and a database has been created.
1 2 3 4 5 6 7 8 9 10 11 |
cd /var/www/vhosts/example.com/httpdocs wp core download wp core config --dbname=wordpress \ --dbuser=user \ --dbpass=password \ --dbhost=localhost wp core install --url="http://example.com" \ --title="Blog Title" --admin_user="adminuser" \ --admin_password="password" \ --admin_email="email@example.com" |
Add this code to wp-config.php to stop redirect loops caused by SSL termination on a proxy or load balancer:
1 2 3 |
/** SSL termination fix **/ if (array_key_exists('HTTP_X_FORWARDED_PROTO',$_SERVER) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on'; |
WP-CLI is a great tool for managing WordPress sites from the command line. As an example you can quickly change a WordPress user’s password with WP-CLI. This can be very handy on sites that you don’t have a WordPress admin login. First, if you don’t already have WP-CLI installed then follow the instructions here:
Then “cd” to the root of the WordPress site and run the following command:
1 |
wp user update <user> --user_pass=<pass> |
Where <user> is the username and <pass> is the new password.
Here’s an example:
1 |
wp user update bob --user_pass=wYdG2qpcZn4OAUik |
You can actually update other user parameters with the “user update” sub-command. See the full docs here:
http://wp-cli.org/commands/user/update/
Applying the new SUPEE-7405 patch to Magento 1.7.0.2 (and probably other versions) results in a parse error in the sales order view page (admin/sales_order/view/order_id) if the site is running under PHP5.3. Here’s the error message:
1 2 |
PHP message: PHP Parse error: syntax error, unexpected '[' in /app/code/core/Mage/Adminhtml/Helper/Sales.php on line 124 |
The offending line is:
1 |
$links = []; |
it can be changed to:
1 |
$links = array(); |
PHP 5.3 does not support the “[]” syntax for array initialization. Of course you should not be running PHP 5.3!