create symfony project using the symfony installer - php

i used to to use composer to create a new symfony project like so
composer create-project symfony/symfony-standard-edition SymfonyProjectDir 2.5.*
but know when i want to use the symfony installer i use the command
symfony new SymfonyProjectDir 2.5.*
or
symfony new SymfonyProjectDir 2.5
but i get this error
[RuntimeException]
The Symfony version should be 2.N.M, where N = 0..9 and M = 0..99
new directory [version]
how can i tel that i want to use the version 2.5 including the last updates from symfony like i used to with composer?

There is no reason to have the latest minor version of an version. You start developing with the latest version and then you should freeze it until there is a reason to update.
If you don't care, clone the git repo, grep your tag and create your project with it.

You can try this, it worked for me:
Symfony Installation and Project Creation
Or just open command line and execute these commands:
for (linux/mac)
sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony
symfony new SymfonyProjectDir 2.5
The version will be the most recent version in 2.5, as you want

Last answer here is from 2016 so if you end up here somehow in 2019 the solution is much easier!
First make sure you are using a php version of 7.1 or higher.
Check if you have composer installed and if you don't just follow this easy documentation: Download/Install Composer
Now you are all set, go to the directory where you want your symfony project be stored and enter the command composer create-project symfony/website-skeleton my-project. This will create your first structure in symfony 4!
Now you just enter your project directory and type php bin/console server:run on your terminal and you are done.
You can import repositories from git too starting git init from the same project folder.
First time with Symfony? Follow this tutorial for a first controller/view: Introduction to symfony4
Hope this if somehow usefull to anyone, i'm just trying to give something back to this community that has given me so much.

Please try with it:
composer create-project symfony/framework-standard-edition SymfonyProjectDir/ 3.0.7
It should work. Maybe your forgot the last slash...

Related

How do I run symfony console?

Everywhere I look in the Symfony documentation for Symfony 4.2, it says that to clear the cache, I run:
php bin/console cache:clear
However, this bin/console is a relative path. I can't find bin/console anywhere. I've done a find on my composer vendor directory. Nothing.
Where is bin/console?
I'm running php 7.2.
Symfony 4.x structures in like this (From CoderSkills)
If you don't have the same after your installation, remove your project folder and create a new ones by running composer create-project symfony/website-skeleton myNewProject
Here is a guide to start a new Symfony project

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

error using composer to install cakePHP 3

i am lost...
i am trying to do it the right way and am following the Quick Start Guide for installing cakePHP 3 on my ubuntu machine.
Got composer installed. Directory is /var/www/cakephp
and am trying to issue:
php composer.phar create-project --prefer-dist cakephp/app mayapp
or
composer create-project --prefer-dist cakephp/app may app
then i am simply getting:
[InvalidArgumentException]
Could not find package cakephp/app with stability stable.
i do not have a clue what i am doing wrong. Any suggestions?
cakephp/app exists on https://packagist.org, and the command looks ok to me.
Which PHP version are you using? That package is only available with PHP 5.4.16 or later, so you must update if you want to use CakePHP.
However, it is a good idea to only use the same PHP version of your public hosting, using a newer version will lead to problems when deploying your code. If your webspace or public server does not have the latest PHP 5.6 running, ask for an update.
I got same issue. But, as previous answer, myapp does not exists on packagist.org, so, you must use laravel/laravel instead, and, after created, rename the new laravel folder to your desired name and move to htdocs (for xampp) or www (for wamp), then, and I do not know why, go to : localhost/laravel/public/
and replace laravel with the name you gave to your project folder instead the laravel one.
You will see Laravel 5 fonts will appear on screen.
That's means Laravel is running.
Hey Please try these steps.
Download XAMPP Server.
Install XAMPP server.
Go to ..\xampp\php\php.ini and open.
Add this line (extension=php_intl.dll) or if exist uncomment.
Download Composer setup from https://github.com/composer/windows-setup/releases/
Install composer and give php.exe file in path
Open cmd and check now php version using command php -v. if its showing php version its means its working.
Now open cmd and cd on xampp\htdocs folder & run command composer create-project --prefer-dist cakephp/app app_name
Finished folder created in htdocs.
Hope this is helpful for you.

Laravel 4.2 install on windows

I want to install Laravel 4.2 installation some packages via Composer. However, I am getting an error
“failed to clone git#github.com:symphony/Translation.git.git was not found. Check that it is installed in your path env. ‘git’ is not recognized as an internal or external command”
I want to use version 4.2.0 which is an older version of laravel. I’m successful to download if I do not mention version number but not when I include version number.
I tried:
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp 4.2 –prefer-dist
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp –prefer-dist 4.2.0
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel newapp –prefer-dist 4.2.*
Or
C:\xampp\htdocs\laravel composer create-project laravel/laravel {{newapp}} 4.2.* –prefer-dist *
All with same error...
What do I need to make it work? Do I need to install git but How? i have no idea thanks for your help.
Note:I have latest composer downloaded yesterday July 24
Why do you want to use an old and not updated version of Laravel?
The first one is the correct way to install Laravel with composer/create-project.
Can you try to clone the laravel/laravel repository and to run composer udpate?
Lynda was a good source of information for me to learn Laravel(4.2) and if I recall there was a course that went into detail on installing Laravel on Windows, I could be wrong but if you have Git installed already you will also need to add it as a variable in your Paths to be used in your prompts.
The link below should help you in setting the Paths to Git and they should be something along these lines.
;"C:\path\git\bin";"C:\path\git\cmd"
http://www.computerhope.com/issues/ch000549.htm
I bullishly downloaded and installed GIT not knowing option to choose (used command prompt option) as Romain suggested , reboot and retried and it worked. Lynda indeed have a chapter on installation but did not mention Git so following instruction failed. Note: only trying previous version failed, was ok for latest laravel 5 version before installation of Git. Thank you all...one day lost of trying and testing but happy ending :)

Installing Laravel 4.1 with Laravel Installer

I'm trying to install Laravel 4.1 using the Laravel installer but the docs isn't very descriptive.
Can someone please give a step by step guide on how to do this? I'm completely new to Laravel and PHP frameworks as a whole.
I'm on a Windows 7 machine running WAMP 2.2.
This information/answer isn't quite up to date anymore. The instructions here will install the latest version which is no longer 4.1. For those still wanting to install Laravel 4.1 (despite 4.2+ being out), use the following command.
composer create-project laravel/laravel project_name 4.1
You could replace the 4.1 with 4.0 or 4.2 depending on your situation.
Laravel 4.1 is handy if you aren't in control of your PHP version and you're stuck back on 5.3.7
Laravel 4.2 requires PHP 5.4.
When upgrading a project to a newer version of Laravel, be sure to review the release notes
Installing Laravel means simply downloading Laravel Application bootstrap, which has to be placed in your project directory. That application has a composer.json file, which will, after you run composer install command, download all necessary dependencies (including core framework).
That is one way. Another preferred way is directly through:
composer create-project laravel/laravel project_name
In both cases, you need to have composer installed on your machine. Composer is a modern PHP package manager, which has a ton of benefits (autoloading, custom commands...).
There is really no need for two downvotes, especially when this guy was reading documentation, which he couldn't understand. We were all installing Laravel for the first time.
If you want install laravel via Laravel Installer use this method:
First, open up command line. then enter:
composer global require "laravel/installer=~1.1"
Now go to:
C:\Users\ {User Name} \AppData\Roaming\Composer\vendor
Copy and paste vendor in your destination folder.
Now in your destination folder hold the shift key down and press right click and in opened navigation menu click on "open command window here" then enter command below:
laravel new your_project_destination
Ex:
laravel new laraveltest

Categories