Interest in Symfony has increased since del.icio.us announced it developed its new version on the Symfony framework. If you are running Vista and you need to get a quick Symfony development environment going, then look no further. Follow these easy steps to going in 20 minutes.
1. Install XAMPP
Just follow the instructions for installation and then:
- During the install, specify XAMPP to be installed under C:Program Files because of Vista security restraints.
- Run http://127.0.0.1/security/index.php to secure XAMPP.
2. Install Symfony
- Press the Win key
- Type cmd
- Press Ctrl+Shift+Enter
- Confirm the elevation prompt
- cd “C:Program Filesxamppphp”
- pear upgrade PEAR
- Note: You will get a pop-up with “CLI has stopped working”, you can safely close that (this will happen during the other command prompt steps as well).
- pear channel-discover pear.symfony-project.com
- pear install symfony/symfony
- pear install phing/phing
3. Setup Your Application
Add symfony to your path:
- Start Orb -> Computer (right click and choose properties)
- Advanced system settings
- Environment Variables…
- Click on the Path System variable and click edit
- At the end of the string, append ;C:Program Filesxamppphp;C:Program Filesxamppmysqlbin
Restart the command prompt for the path variable to set.
Set up a sample project:
- cd [path to your workspace]
- mkdir myproject
- cd myproject
- symfony init-project myproject
- symfony init-app myapp
4. Configure the Web Server
Set up a named host:
- Go to C:WindowsSystem32driversetc in explorer and right click on the host file. Uncheck the read only box.
- Hit the windows key
- Type notepad.exe
- Cntrl+Shift+Enter
- File -> Open
- Open C:WindowsSystem32driversetc (you will have to put an * in the file name box to see the file) and open the hosts file
- Add “127.0.0.1 myproject” under “127.0.0.1 localhost” (without the quotes)
- Save
- Go to C:WindowsSystem32driversetc in explorer and right click on the host file. Check the read only box.
- File -> Open
- C:Program Filesxamppapacheconfextra (you will have to put an * in the file name box to see the file) and open httpd-vhosts.conf
- Add this to the end of the httpd-vhosts.conf file and save:
<VirtualHost *:80>
ServerName myproject
DocumentRoot “C:[path to your workspace]myprojectweb”
DirectoryIndex index.php
Alias /sf C:php5peardatasymfonywebsf
<Directory “C:php5peardatasymfonywebsf”>
AllowOverride All
Allow from All
</Directory>
<Directory “C:[path to your workspace]myprojectweb”>
AllowOverride All
Allow from All
</Directory>
</VirtualHost> - Uncomment ##NameVirtualHost *:80 if you want to have more than one project able to run with different names.
- Restart Apache and go to http://myproject/ and you should see the symfony default project page.
5. Setup File Folder Permissions
Now you need to allow for write access to the cache and log folder.
- Traverse to each those two directories seperately within your newly Symfony file structure with Explorer.
- Right click on each of the folders and choose properties
- Go to the security tab and choose the user that will be granted the permissions and click edit.
- Note: You can find out the user by Cntrl+Alt+Delete, and then starting the task manager. Note the User Name.
- Allow that person to have full control.
NEXT STEPS
I suggest you install Aptana or PHPEclipse for your IDE.
You will also want to setup TortoiseSVN or use SVN from inside Cygwin for a version control client.
The Askeet tutorial is a good way to learn about programming in Symfony.
If you prefer learning on paper, I suggest you check out the official Symfony book: The Definitive Guide to symfony (Definitive Guide). Or read it online free here.
Speak Your Mind