Tag: mysql

Using MySQL Enums in Symfony Doctrine

Enum isn’t supported in Doctrine. I prefer to keep things as vanilla as possible so instead of registering a new type, we shall map it to a varchar.

You have to ensure that each varchar field that is an “enum” in the database only gets passed the allowed values. You can easily enforce this in your entities:

This is a lot easier to manage and requires no migration if you decide to add more options.

source: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/mysql-enums.html

How To Install LAMP in Ubuntu

Step-by-step instructions on how to install LAMP (Linux Apache MySQL PHP) in Ubuntu.

Before we start, it’s best to do an update:

Apache

Install the webserver.

PHP5

Install PHP5 along with it’s apache module.

MySQL

Install MySQL along with it’s php and apache modules.

Then restart the server with:

Alternative, you can ignore everything above and just run the following commands:

Presumably, it just installs the same things, only with less typing copy pasting.