Symfony Error

You are not allowed to access this file. Check app_dev.php
-----------------------------------------------------------

Try to remove this two lines from app_dev.php .It works for me
{
 header('HTTP/1.0 403 Forbidden');
 exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}

Advertisements

Symfony Documentation

Installing Symfony by composer

after composer installation then install the symfony. command in your shell:

php composer.phar create-project symfony/framework-standard-edition my_project_name

toolbar hide:

app > config > config_dev.yml
toolbar: false

Creating database:

database create by command follow the symfony documentation.

Creating an Entity Class:

command in your shell:
cd htdocs
cd eventmanage
php bin/console doctrine:generate:entity

The Entity shortcut name: AppBundle:Category

New field name(press <return> to stop adding fields): name

New field name(press <return> to stop adding fields): create_date
Field type[string]:datetime

Entity table relation:

Entity > fileName.php
/**
* @var int
*
* @ORM\ManyToOne(targetEntity=”Category”, inversedBy=”events”)
*/
private $category;

Creating the Database Tables/Schema

command in your shell:
php bin/console doctrine:schema:update –force

Fetching Data from Database:

follow the symfony documentation > guides > Databae(Doctrine ORM)

How to remove “web/app_dev.php” from Symfony URLs?

web > htaccess change base url
app.php
to
app_dev.php

How to change directory

http://localhost/eventmanage/web/app_dev.php

to

http://localhost/eventmanage

just cut all file from the web folder and past root folder then change app.php
/vendor/autoload.php’;
/var/bootstrap.php.cache’;