Installing and Configuring Sf2 using Composer


Instalasi dan Konfigurasi Framework PHP Symfony2 / Sf2

Instalasi dan konfigurasi awal dengan komposer seperti pada umumnya framework php yaitu menggunakan Composer adalah dengan perintah “composer create-project” sebagai berikut :

  1. pastikan php curl sudah ada kalau belum eksekusi perintah ini

    sudo apt-get install curl php5-curl

  2. sekarang coba bikin project Symfony2 yang bernama “learning1” dengan perintah di console :

    composer create-project symfony/framework-standard-edition learning1

    atau untuk versi yang spesifik bisa dengan menggunakan :

    composer create-project symfony/framework-standard-edition my_project_name “2.3.*

  3. Outpunya bakal seperti ini, oh ya di akhir-akhir akan di prompt tentang informasi database dan smtp email server kita (lihat text biru), ini contohnya :

    yusuf@yusuf-VirtualBox:/var/www/html/learning$ composer create-project symfony/framework-standard-edition learning1
    Installing symfony/framework-standard-edition (v2.7.3)
    – Installing symfony/framework-standard-edition (v2.7.3)
    Loading from cache

    Created project in learning1
    > SymfonyStandard\Composer::hookRootPackageInstall
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    – Installing doctrine/lexer (v1.0.1)
    Loading from cache

    – Installing doctrine/annotations (v1.2.6)
    Loading from cache

    – Installing twig/twig (v1.18.2)
    Loading from cache

    – Installing psr/log (1.0.0)
    Downloading: 100%

    – Installing doctrine/inflector (v1.0.1)
    Loading from cache

    – Installing doctrine/collections (v1.3.0)
    Loading from cache

    – Installing doctrine/cache (v1.4.1)
    Loading from cache

    – Installing doctrine/common (v2.5.0)
    Loading from cache

    – Installing symfony/symfony (v2.7.3)
    Downloading: 100%

    – Installing jdorn/sql-formatter (v1.2.17)
    Downloading: 100%

    – Installing doctrine/doctrine-cache-bundle (v1.0.1)
    Downloading: 100%

    – Installing doctrine/dbal (v2.4.4)
    Downloading: 100%

    – Installing doctrine/doctrine-bundle (v1.5.0)
    Downloading: 100%

    – Installing doctrine/orm (v2.4.7)
    Loading from cache

    – Installing incenteev/composer-parameter-handler (v2.1.1)
    Downloading: 100%

    – Installing sensiolabs/security-checker (v2.0.5)
    Downloading: 100%

    – Installing sensio/distribution-bundle (v4.0.0)
    Downloading: 100%

    – Installing sensio/framework-extra-bundle (v3.0.9)
    Downloading: 100%

    – Installing kriswallsmith/assetic (v1.2.1)
    Downloading: 100%

    – Installing symfony/assetic-bundle (v2.6.1)
    Downloading: 100%

    – Installing monolog/monolog (1.15.0)
    Downloading: 100%

    – Installing symfony/monolog-bundle (v2.7.1)
    Downloading: 100%

    – Installing swiftmailer/swiftmailer (v5.4.1)
    Downloading: 100%

    – Installing symfony/swiftmailer-bundle (v2.3.8)
    Downloading: 100%

    – Installing sensio/generator-bundle (v2.5.3)
    Downloading: 100%

    sensio/framework-extra-bundle suggests installing symfony/psr-http-message-bridge (To use the PSR-7 converters)
    kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the integration with the lessphp LESS compiler)
    kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the integration with the scssphp SCSS compiler)
    kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provides the integration with the SCSS compass plugin)
    kriswallsmith/assetic suggests installing patchwork/jsqueeze (Assetic provides the integration with the JSqueeze JavaScript compressor)
    kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides the integration with phpcssembed to embed data uris)
    symfony/assetic-bundle suggests installing kriswallsmith/spork (to be able to dump assets in parallel)
    monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
    monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
    monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
    monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
    monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
    monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
    monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
    monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
    monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
    monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
    Generating autoload files
    > Incenteev\ParameterHandler\ScriptHandler::buildParameters
    Creating the “app/config/parameters.yml” file
    Some parameters are missing. Please provide them.
    database_host (127.0.0.1): 127.0.0.1
    database_port (null): 3306
    database_name (symfony): symfony_learning_1
    database_user (root):
    database_password (null): root
    mailer_transport (smtp):
    mailer_host (127.0.0.1): smtp.gmail.com
    mailer_user (null): emailsayaaja@gmail.com
    mailer_password (null): passwordemailsaya
    secret (ThisTokenIsNotSoSecretChangeIt): initerserahkamumaudiisiapaajabolehkokyangpentingok
    > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
    > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
    Clearing the cache for the dev environment with debug true
    > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets
    Trying to install assets as symbolic links.
    Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
    The assets were installed using symbolic links.
    Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
    The assets were installed using symbolic links.
    > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile
    > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles
    > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget

  4. sekarang coba nyalakan server :

    yusuf@yusuf-VirtualBox:/var/www/html/learning/learning1$ ./app/console server:run
    Server running on http://127.0.0.1:8000

    Quit the server with CONTROL-C.

Kembali ke daftar isi

3 thoughts on “Installing and Configuring Sf2 using Composer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s