Skip to content

PrepareDevWorkstation

Adrien Gallou edited this page Aug 25, 2014 · 1 revision

PrepareDevWorkstation

Some requirements

  • php
  • apache-mod_php
  • php-cli
  • php-pdo_mysql
  • mysql
  • wget
  • git
  • subversion

Clone the repository

If you don’t have commit rights on the project (ie we never added you SSH key), you can have a read-only clone:


git clone git://gitorious.org/mageia-app-db/mageia-app-db.git

Else:

git clone [email protected]:mageia-app-db/mageia-app-db.git

Check configuration

curl https://raw.github.com/vjousse/symfony-1.3---1.4/master/data/bin/check_configuration.php | php

Install missing requirements if needed. A php accelerator is not required but not forbidden either.

Database

Create a new empty MySQL database.

Get dependencies (symfony, propel…)

php composer.phar install

Fill database

sh init

On the first run of init you will be prompted for connection information for your database.

Set up permissions in project root

./symfony project:permissions

Remember that the apache (or www-data) user (=apache on mageia/mandriva) must have read access to the directory where you cloned the project.

Madb configuration file

The init task we called earlier has copied the default configuration to config/madbconf.yml.

For development, default values should be ok, but feel free to change the configuration to fit your needs.

Test data

If you want to insert test data, call the insert-test-data task:


./symfony insert-test-data

It will download test data for mageia then insert them in your database.

In case of problem with “LOAD DATA LOCAL INFILE”, call insert-test-data with —load-cli:


./symfony insert-test-data —load-cli

Apache configuration

Set a virtualhost or alias.

Basic example:

This example works for apache < 2.4. For 2.4 and above, it need some changes, see http://httpd.apache.org/docs/2.4/upgrading.html

NameVirtualHost *  
<VirtualHost *>
	
	ServerName mageia-app-db.localhost
	ServerAlias mageia-app-db.adrien-lap.zone-ttp.com
	ServerAdmin webmaster@localhost
	
	DocumentRoot /home/ttp/mageia-app-db/web
	Alias /sf /home/ttp/mageia-app-db/lib/vendor/symfony/data/web/sf
	DirectoryIndex index.php
	<Directory "/home/ttp/mageia-app-db/web">
		AllowOverride All
		Allow from All
	</Directory>
	<Directory "/home/ttp/mageia-app-db/lib/vendor/symfony/data/web/sf">
		AllowOverride all
		Allow from all
	</Directory>
</VirtualHost>

with this setup, you can access madb at http://localhost/

for better vhost setup, see: http://www.symfony-project.org/getting-started/1_4/en/05-Web-Server-Configuration