Symfony 4 - No route found after installation on Mac - php

I have tried to install the Symfony 4 on my Macbook Air by using Composer. I have used the below commands for installing and running Symfony application
composer create-project symfony/website-skeleton symfony4
cd symfony4
composer require server --dev
php bin/console server:run
And then tried to access the application in http://127.0.0.1:8000/. Below is the error message
Below image shows the error in which line and file
I am using PHP 7.2.3 and installed by using Homebrew. At the same time when I use the below command to install, Symfony welcome page appears without any error.
composer create-project symfony/skeleton symfony4

There is no default welcome page when you create new symfony flex application and there is an issue and a pull request already.
Everything is working fine you just don't have any pages.

Here you can read how to create a symfony page: https://symfony.com/doc/current/page_creation.html

Related

Laravel 8 - Bootstap ui does not install

In my Laravel 8 application, after installing laravel ui, when I try to run 'php artisan ui bootstrap' I get the following error:
In Bootstrap.php line 70:
copy(C:\xampp\htdocs\netlytics\resources\js/bootstrap.js): Failed to open stream: No such file or directory
I have run composer update successfully.
I have laravel/ui version 3.2.0. I am running Laravel 8.40.0 with PHP 8.0.3.
The site is an old site that I upgraded from Laravel 5.3 and PHP 5.6.
The pre-processing was being done using gulp with a gulpfile.js to configure the mix conversions.
With Laravel 8 I know I need to update my pre-processing to use webpack.mix.js, but so far can't get there.
There is supposed to be a resources/app/bootstrap.js file but it is not showing up and I do not know what it should look like if I wanted to put it there.
Any ideas how to get this installed correctly?
I poked around and finally discovered that I needed to install jQuery and jQuery-ui as well as popper.js. I installed those and again got the same error, but this time I just created a resources/app/bootstrap.js file and when I ran 'php artisan ui bootstrap' it ran and populated the bootstrap.js file.
Here solution:
https://stackoverflow.com/a/68393896/15391779
composer create-project laravel/laravel --prefer-dist laravel-bootstrap
composer require laravel/ui
php artisan ui bootstrap --auth
npm install
npm run dev

Testing Symfony flex on Windows

I can't make composer working with flex receipe on a symfony4 project, on Windows.
Here is the complete process :
I installed PHP7.2 from http://windows.php.net/download#php-7.2 (VC15 x86 Non Thread Safe), PATH env is set. php.ini is created (from php.ini-development). PHP is working on windows (php -v).
I installed composer from the Composer-Setup.exe (https://getcomposer.org/download/). It changed the php.ini for me for activating some php extensions (openssl, etc).
I created a project with composer create-project symfony/skeleton sf4
I moved to sf4 dir : cd C:/sf4
I run Web Server : php -S 127.0.0.1:8000 -t public
It works when I browse locahost:8000
So I want to install the symfony twig bundle as a flex package : composer require twig
The error I get :
[InvalidArgumentException]
Could not find package twig.
Did you mean one of these?
twig/twig
slim/twig-view
latte/latte
twig/extensions
timber/timber
I tried with a local composer.phar inside the sf4 project :
cd C:/sf4
php composer.phar require twig
=> same error
Composer seems to ignore flex plugin, do you have any idea ? Thx !
see the answer of nicolas-grekas in the following link
you can continue using the symfony containers in this link, just look for the alias that flex used.
in your case twig for flex is "symfony / twig-bundle", run composer req symfony / twig-bundle.
salu2

Not able to install symfony on windows

Hello I am trying to install symfony on Windows. I had follow the all require steps for it but it end up with below message.
[RuntimeException]
Symfony can't be installed because the downloaded package is corrupted.
To solve this issue, try executing this command again:
Symfony new demo 3.2.8
When i tried above command it says :
'symfony' is not recognized as an internal or external command,
operable program or batch file.
I have try to reinstall composer and Symfony package both but it does not resolve the issue. It stays the same issue again.
Please help me how can I install it on Windows.
You are required to make it run through PHP as its a script file.
This gets the installer (which it looks like you have already)
php -r "readfile('https://symfony.com/installer');" > symfony
Then php symfony new demo 3.2.8 (asuming if php is in path otherwise you have to specify the php.exe path too)
For the full details see http://symfony.com/doc/current/setup.html
Regards
forget about that installer use composer from command line
composer create-project symfony/framework-standard-edition my_project_name
BTW i don't know what server you are using (wamp/xamp etc), i recomending this
https://laragon.org/
it have composer and all tools that you need to start with symfony

How to integrate ACL in Symfony 3.0?

I am new in symfony 3.0. I want to integrate ACL in my project.I am using following environment.
Symfony 3.0
OS: Windows
I did follow below link:
http://symfony.com/doc/current/cookbook/security/acl.html
When I run this command: php bin/console init:acl
I am getting following message:
[LogicException]
You must install symfony/security-acl in order to use the ACL functionality
Can anyone suggest how I can integrate it? Is there any demo URL and from where I can download the code?
You are missing a package that Symfony needs in order to activate ACL on your project.
To install such packages, you'll need to have a working Composer installation (Composer is a PHP dependency management scripts you can use to manage packages): see https://getcomposer.org/download/
Once Composer is running, you can open a console and go to the root of your project. There you can run the following command line option:
composer require symfony/security-acl
followed by:
composer update
Now you should be able to run the php bin/console init:acl command successfully.

Composer BowerPHP Error

I am trying to install BowerPHP in my Laravel framework project on my computer using Composer. I have used the composer require "beelab/bowerphp 0.3.*#beta" command in the command prompt but I'm receiving errors:
Can only install one of : symfony/process[v2.7.9,v3.0.2]
Can only install one of : symfony/process[v2.7.8,v3.0.2]
Can only install one of : symfony/process[v2.7.7,v3.0.2]
etc.
From what I understand my framework already has a version of Symfony and I cannot download another package. In addition, the package that I have is not compatible with BowerPHP. What do I do? And am I correct?
So I found the answer. The beelab team did not update their own website but did update their github page. running the composer require beelab/bowerphp:1.0.*#dev would work but running the on on their website would not.

Categories