How to successfully deploy a fully working php/symfony environment in Snow Leopard III: Apache+PHP5
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!