Posted: March 21st, 2010 | Author: alej | Filed under: tutorials | Tags: apache, php, tutorial | 3 Comments »
Ok, so now that we have the database, let’s work a bit in the fronted, with Apache and PHP5. Apache comes already installed in our machine, we just have to start it in the Sharing option of the Control Panel. Check “Web sharing” to start apache and uncheck it to shut it down.

That was easy, wasn’t it? Now we have to enable php in apache’s configuration file, as it comes disabled by default.
$ sudo vim /etc/apache2/httpd.conf
Now let’s navigate to the commented line where php5 is (it’s easy to go there by typing /php5) and uncomment the line (by removing the first # symbol).
Save and quit the file (by typing :wq) and restart apache by unchecking and checking again the checkbox in the sharing option of the control panel, as explained before.

Well, now we should have php5 working in our machine. Let’s check it by creating a simple php file and displaying it:
$ echo “<? phpinfo(); ?>” > ~/Sites/test.php
Now browse to http://localhost/~yourusername/test.php and see all the info php has about you. Do not forget to change yourusername in this example with your real username.

That wasn’t so hard! Now that you have apache+php working, you really should learn to configure them. Read the apache docs and the php docs.
See you around!
Posted: March 1st, 2010 | Author: alej | Filed under: tutorials | Tags: development environment, mysql, tutorial | No Comments »
Let’s start our journey the easy way: with MySQL. First of all we need to download a copy of the MySQL Community Server, preferably in .dmg format, from here. For this tutorial I have selected this one: Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive, the first one. To proceed, we have to register or press the “No thanks” link under the form and select a mirror.
Once we have the dmg file, we mount it (by double clicking it..) and we could see the contents of the package:

To actually install the application, we have to double click the first .pkg file, named something like “mysql-5.1.44-osx10.6-x86_64.pkg” and proceed through the installation. We may be asked our password for administrative purposes.
Now that we have installed mysql, we are provided three ways to start the server:
- The ugly command line, with mysqladmin
- Autostart the server, installing the provided MySQLStartupItem.pkg, but we want to have more control than that..
- And by an individual control “switch” in the preferences panel. Let’s do that, so we are able to start/stop the server whenever we want in an easy way!
So double click in the MySQL.prefPane file and install the panel only for your user (you don’t have a sister who likes programming, do you?). Now, when we want to manipulate the state of the mysql server, we just have to go to this panel and turn it on or off (I personally do it with +space and then typing mysql).

Mind that normally, when manipulating the state of the mysql server we will be requiered administrative priviledges, so we will be asked for our password quite often.
And that’s it, we have installed MySQL Server in our mac… but beware, as the default installation doesn’t provide a password for the root user!
To do so, we need to use the terminal, setting the mysql installation dir in our path and setting a new password for root.
$ echo ‘PATH=$PATH:/usr/local/mysql/bin’ >> ~/.bash_profile
Restart the terminal and then:
$ mysql_secure_installation
Press enter, as root does not have any password right now
Press enter, so we are asked for a new root password
Enter the new root password
Press enter, so we remove the anonymous user
Press enter, so we disallow root login remotely
Press enter, so we remove the test database
Press enter, to reload the privilege tables
And we’re done!
You could test your freshly installed copy of mysql with mysql -uroot -p
Links:
If you run into trouble, maybe this apple guide could help you.
Posted: March 1st, 2010 | Author: alej | Filed under: tutorials | Tags: development environment, index, php, symfony, tutorial | No Comments »
This is the first part of a multi-series of posts regarding the installation and configuration of a fully development environment for symfony, the best PHP framework out there.
This will be oriented to a normal desktop Snow Leopard installation on a mac computer, but other platforms would be explained in further tutorials.
We’re going to need a bunch of things installed for this to work, but we won’t encounter any major problems, I hope:
- Mysql
- Apache + PHP5
- MysqlAdmin
- xDebug+PHPUnit+Pear
- Eclipse
- symfony
- Any other tool to improve our workflow, such us svn, git… suggestions are welcomed.
This post will serve as an index for future chapters, to facilitate access and/or references.
Posted: February 19th, 2010 | Author: alej | Filed under: Uncategorized | Tags: evil, motto | No Comments »
Starting today, our new motto will be…
“Don’t be too much evil”
Posted: January 25th, 2010 | Author: alej | Filed under: Uncategorized | Tags: art, motivation, poster, recruiting | 1 Comment »
So, I was kind of bored the other day and started messing with photoshop, wondering if something nice could come along… This is the result, a recruting poster for Lab216.
Soon there will be more to come…