Choose Language

Mateusz Marchel

I'm doing PHP development since 2012. I'm passionate about new technologies and for couple years I like WordPress very much. If you think that I can help you, please send me an e-mail. I love new challenges!

Privately I have beautiful wife Edyta, I like good music and I play guitar in my free time.

Categories

Recent Posts

Archives

WordPress on AWS EC2 – part 7

What else need your WordPress?

WordPress use some additional modules for Apache and PHP. Unfortunately I haven’t found many information about what is actually needed and for what purpose. There are some articles on this subject, but they’re quite old. In this section I’ll show you couple of WordPress features which don’t work in our environment and how to fix it.

Pretty URLs

So let’s begin with turning on preety URLs. This feature help us make our URLs more readable and SEO friendly. In our WordPress Dashboard find tab Settings->Permalinks. There let’s choose one of option we like and save settings. Let’s go back to home page and try to click on post title. Whoops…

In this case the problem is disabled rewrite module in Apache. Let’s enable it:

1

2

sudo a2enmod rewrite

sudo service apache2 restart

Much better now. 🙂

wp_mail

In previous part I wrote that our WordPress can’t send emails and I suggest installing plugin which allows us send messages through SMTP. Let’s install it then from dashboard. We can of course do it also using WP-CLI or upload files manually. Before we proceed to plugin installation, let’s install first another PHP module. It’s not necessary now because WordPress can work without it, but some plugins could not.

1

2

3

sudo apt-get install php5-curl

sudo php5enmod curl

sudo service php5-fpm restart

Okay, now we can install Easy WP SMTP (or any other with similar functionality). Configuration is very straightforward – just like configuration any e-mail client like Outlook or Thunderbird.

This plugin have feature which help us examine if everything is correct by sending test email. If you’re using another plugin which doesn’t have this kind of functionality you can for example change password for your user. WordPress should automatically send e-mail with information about password change to e-mail address attached to your account.

Images scaling and cropping

When we upload image to our WordPress media library, they are automatically processed and we can use different image sizes in our posts. Additionally we can use built-in image editor which help us crop image for example. So at least it should work that way but now if we try to put image into post we can use only full image size.

This is because we don’t have PHP module called imagick. Let’s install it then. We’ll also install module called GD. In fact for WordPress itself imagick is sufficient, but some plugins could use GD for image manipulation.

1

2

3

sudo apt-get install php5-gd php5-imagick

sudo php5enmod gd imagick

sudo service php5-fpm restart

Now if you upload new image it should be possible to use different image sizes and built-in image editor.

Additional modules

Some plugins are using module called mcrypt so we can install it by the way:

1

2

3

sudo apt-get install php5-mcrypt

sudo php5enmod mcrypt

sudo service php5-fpm restart

This set of extensions should be sufficient in most cases.

So we actually done. In last part I’ll summarize everything what we’ve done and make some additional comments.