Can’t Reach wp-admin

When moving / cloning a site to a new URL, just changing the wp-options option_value is not enough. The proper way of doing this is to use a wordpress site cloning plugin (lot’s of free good ones), such as Duplicator. Do a proper archive and install the site on AWS. It should take care of … Read more

How to connect to AWS RDS external database (not for the core WordPress db)

I was able to get a working connection using the following code: function test_connect_to_db() { $servername=”thedatabase.0000000000.location-1.rds.amazonaws.com”; $username=”username”; $password = ‘password’; $dbname=”database”; // Create connection $conn = new mysqli( $servername, $username, $password, $dbname ); // Check connection if ( $conn->connect_error ) { die( ‘Connection failed: ‘ . $conn->connect_error ); } $sql=”SELECT id, firstname, lastname FROM table”; … Read more

PHP/MySQL issues when running WP on EC2 cloud [closed]

Try logging into the mysql instance from the command line by typing in mysql -u root -p and then entering your mysql root password. If you can connect, even if it rejects your username and password, you know it’s up and running correctly. From that point you can diagnose whether it is username/password issues or … Read more

How To install AWS SDK for PHP in wordpress?

Install Amazon Web Services Plugin. (https://wordpress.org/plugins/amazon-web-services/) Add all the required keys, at the AWS menu that now should be available in your WP dashboard. Include the library in your code, in my case was: require ‘/path/to/plugins/amazon-web-services/vendor/aws/aws-autoloader.php’; Enjoy!

Enqueue AWS Script

Try to save jQuery.noConflict(); as jquery-no-conflict.js. Then enqueue everything with proper dependencies: <?php function img_scripts_with_jquery() { wp_enqueue_script( ‘jquery-no-conflict’, ‘path/to/jquery-no-conflict.js’, array( ‘jquery’ ), ‘version’, true ); wp_enqueue_script( ‘aws-cba’, ‘https://images-na.ssl-images-amazon.com/images/G/01/cba/js/common/cba_shared.js’, array( ‘jquery-no-conflict’ ), ‘version’, true ); wp_enqueue_script( ‘aws-merchant-cart’, ‘https://images-na.ssl-images-amazon.com/images/G/01/cba/js/shoppingcart/merchant_cart.js’, array( ‘jquery-no-conflict’ ), ‘version’, true ); } add_action( ‘wp_enqueue_scripts’, ‘img_scripts_with_jquery’ );

Securing my WordPress Files and Directories

Why would you want to protect them all? Not all of them need protecting, in my humble opinion. In any event, these are good to have in your .htaccess file: 1: restrict access to wp-config.php <Files wp-config.php> order allow, deny deny from all </Files> 2: restrict access to .htaccess itself <Files .htaccess> order allow,deny deny … Read more