NGINX Rewrite for Laravel

Recently I’ve found a new PHP framework, the Laravel ( I bought a book about it (, that by the way it’s excellent, and went to study to use Laravel on a new project.

As always, my first challenge is doing a functional configuration on NGINX, to make Laravel running straight, and as CakePHP and WordPress, it comes with .htaccess ready for Apache. The book shows a configuration to a project that is based on the root of a webserver, but I put all my projects on subfolders on the VM that I use to develop, so it’s not the same thing as the book shows.

Continue reading “NGINX Rewrite for Laravel”

Security on CakePHP

One issue that involves security on CakePHP 2 is the configuration of those keys that they call salt and cipherSeed… The code below can be used to generate those keys:

This code can be executed on terminal.


File Upload on CakePHP

I have a file manager written on PHP and I’m transfering all it’s logic to CakePHP 2.1, making it object oriented…

Yesterday I was working with the file upload section, that gets the file from the client and saves on the server, including saving some details of the file on the database. The difficult part was doing that using the CakePHP resources, because I didn’t knew them yet.

Example 1: I usually develop on Linux, that uses / for paths, but yesterday I was on Windows, that uses \. How to treat that??

Example 2: I was using PHP functions to create the directories (mkdir), remove directories (rmdir) and do the upload (move_uploaded_file). How to do that on CakePHP??

Continue reading “File Upload on CakePHP”