[Solved] Laravel: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Recently I set up a project with the laravel PHP framework and hit a little bump right away. After cloning my project on my computer at home, I encountered an error message about the AES key length.

Luckily I wasn’t the only one with that issue and running the following and conveniently available artisan commands fixed it already:

php artisan key:generate
php artisan config:clear

Continue reading “[Solved] Laravel: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.”

Searching the Google Books API with PHP [Quickstart]

APIs are always fun to me, because you gain access to a large pool of information. Today I want to take a quick look at how to access the Google Books API with PHP. The code snippets and general knowledge should be applicable to all kinds of other Google APIs like YouTube or Google+.

Requirements

To access the Google API you will need an API key, which firstly requires you to register a project as a developer and then register your application as a client for the Google Books API. I have heavily screenshotted that process, because I didn’t find it very intuitive.

Secondly I’ll be using Composer for the ones that have php executable in their command line, most likely MacOS and Linux users. If you don’t want anything to do with composer, you can also download the Google API client manually from github.

Continue reading “Searching the Google Books API with PHP [Quickstart]”

NGINX / Apache: Block Requests to PHP file (xmlrpc.php)

This is going to be a short post about how to block your webserver from serving a specific file.

WordPress comes with a file called xmlrpc.php which enables you to use their mobile App on self-hosted blogs or enables ping- and trackbacks. However, there is a bunch of bots out there that attempt to brute-force their way in and can produce either high load or actually present a security risk.

Continue reading “NGINX / Apache: Block Requests to PHP file (xmlrpc.php)”

Best Free Source Code Editors for e.g.: HTML, CSS, JavaScript

This is a list of the best free source code editors, especially for web programming, for example for JavaScript, HTML or CSS, with some useful indications about features, difficulty and which platforms they are available for. If you’re looking to find the best fit for you, keep reading. This list is full of beginner friendly editors that also can be customized to fit your coding needs, no matter if it’s for HTML, CSS, JavaScript, Ruby, Python or PHP.

Continue reading “Best Free Source Code Editors for e.g.: HTML, CSS, JavaScript”

Phalcon, a high performance PHP MVC framework

Phalcon comes as a C binary, which you can set up as a PHP module in your php.ini. It makes the framework functionality available as PHP classes, so you won’t actually have to worry about the C part after the initial installation.

phalcon-php-lightweight-high-performance-framework

I’ve been writing PHP as one the first languages I learned, because I wanted to build web things, after learning the basics of programming in Python. Now, lately I’ve been writing a lot of JavaScript, both for Frontend and Backend, so obviously with node.js.

It’s great to see this approach coming to the PHP world and it seems like a possibility to make PHP one of the first choices for building APIs. The wide spread of the language could lead to adoption, if the some hosting companies jump this wagon.

The downside compared to other frameworks is of course, that you need to have control over your hosting environment to install the binary component.

The Volt Templating Engine

The Volt Templating Engine seems very familiar and includes functionality like blocks, variables in double curly brackets, conditionals and filters for string transformation.

{% if show_navigation %}
  <ul id="navigation">
  {% for item in menu %}
    <li><a href="{{ item.href }}">{{ item.caption }}</a></li>
  {% endfor %}
  </ul>
{% endif %}

Summary

Phalcon seems like a promising candidate for running PHP at scale. Although PHP is not my first choice any more, I do like to see it evolve and blossom in different frameworks and approaches.

(discovered via Thomas)

Buffer Jobs, hiring page done right!

I just stumbled upon buffer’s hiring page and I think it’s great. It shows what they’re doing, is visually beautiful and deserves a look! Buffer allows you to time your updates on social networks like twitter, facebook, linkedin and google plus. You can set which post you want to publish on which network and also when, so your posts don’t stop when you go offline or so you’re sure to hit your target group when they’re browsing a tag. Continue reading “Buffer Jobs, hiring page done right!”

PHP MVC: The Laravel Framework

The Laravel project has made a pretty smart move, that now is also in their quick start guide. They enable you to install it directly through composer! I’ve written about composer once when I ran into a little quirky bug on MacOS.

Using composer, which is a general dependency manager for PHP seems like a big step towards more interchangeable code between different PHP frameworks. I’ve briefly looked into Sparks some time ago, but it’s pretty specifically aimed at the CodeIgniter framework. Continue reading “PHP MVC: The Laravel Framework”

Codeacademy.com releases PHP course

Codeacademy.com has just started releasing a PHP course to their track and progress based code learning system.

Right now only the Welcome to PHP! chapter is available, but more are listed and flagged as planned. Also a call for collaboration is included, since you can actually write the course.

Continue reading “Codeacademy.com releases PHP course”

Best PHP MVC frameworks of 2013

Frameworks are making your life easier, since they take care of common tasks you without them would have to repeat for every project or even within projects.

I have assembled a small list of promising candidates for you, they may not be the most commonly used, but they teach best practices, principles like MVC and have communities and thereby helping hands on the internet.

This post was originally written for the semester blog of my class, therefore it also focusses on the types of database queries supported by the frameworks, we have a dedicated module in SQL and databases, which is why it is pretty relevant to the students of my semester. Continue reading “Best PHP MVC frameworks of 2013”